Skip to content

Commit 19666bb

Browse files
mathieuchopstmnashif
authored andcommitted
drivers: gpio: stm32: bubble-up wake-up pin configuration error
When an error occurs while attempting to configure a GPIO pin as wake-up pin, return the error to the caller instead of merely printing a log message which may not even be displayed. Signed-off-by: Mathieu Choplain <[email protected]>
1 parent eef720f commit 19666bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpio/gpio_stm32.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,11 @@ static int gpio_stm32_config(const struct device *dev,
530530
.dt_flags = (gpio_dt_flags_t)flags,
531531
};
532532

533-
if (stm32_pwr_wkup_pin_cfg_gpio((const struct gpio_dt_spec *)&gpio_dt_cfg)) {
533+
err = stm32_pwr_wkup_pin_cfg_gpio(&gpio_dt_cfg);
534+
if (err < 0) {
534535
LOG_ERR("Could not configure GPIO %s pin %d as a wake-up source",
535536
gpio_dt_cfg.port->name, gpio_dt_cfg.pin);
537+
return err;
536538
}
537539
#else
538540
LOG_DBG("STM32_GPIO_WKUP flag has no effect when CONFIG_POWEROFF=n");

0 commit comments

Comments
 (0)