Skip to content

Commit 82d17f1

Browse files
ydamigosnashif
authored andcommitted
gpio_smartbond: Remove pdc entry only if it exists
Remove pdc entry only if index exists when CONFIG_PM is set. Signed-off-by: Ioannis Damigos <[email protected]>
1 parent df86860 commit 82d17f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpio/gpio_smartbond.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ static int gpio_smartbond_pin_interrupt_configure(const struct device *dev,
242242
config->wkup_regs->clear = pin_mask;
243243
data->both_edges_pins &= ~pin_mask;
244244
#if CONFIG_PM
245-
da1469x_pdc_del(pdc_ix);
245+
if (pdc_ix >= 0) {
246+
da1469x_pdc_del(pdc_ix);
247+
}
246248
#endif
247249
} else {
248250
if (trig == GPIO_INT_TRIG_BOTH) {

0 commit comments

Comments
 (0)