Skip to content

Commit 80681d2

Browse files
Flavio Ceolinnashif
authored andcommitted
stm32: gpio: Fix device runtime pm
When CONFIG_PM_DEVICE_RUNTIME is enabled, if a pin is configure as input after an output pin has already being configured the device is wrongly suspended. Fixes #38433 Signed-off-by: Flavio Ceolin <[email protected]>
1 parent 79ff645 commit 80681d2

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/gpio/gpio_stm32.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -464,15 +464,10 @@ static int gpio_stm32_config(const struct device *dev,
464464
}
465465

466466
#ifdef CONFIG_PM_DEVICE_RUNTIME
467-
enum pm_device_state state;
468-
469-
(void)pm_device_state_get(dev, &state);
470467
/* Enable device clock before configuration (requires bank writes) */
471-
if (state != PM_DEVICE_STATE_ACTIVE) {
472-
err = pm_device_get(dev);
473-
if (err < 0) {
474-
return err;
475-
}
468+
err = pm_device_get(dev);
469+
if (err < 0) {
470+
return err;
476471
}
477472
#endif /* CONFIG_PM_DEVICE_RUNTIME */
478473

0 commit comments

Comments
 (0)