Skip to content

Commit c370bb4

Browse files
Fabien Dessennelinusw
authored andcommitted
pinctrl: stm32: use valid pin identifier in stm32_pinctrl_resume()
When resuming from low power, the driver attempts to restore the configuration of some pins. This is done by a call to: stm32_pinctrl_restore_gpio_regs(struct stm32_pinctrl *pctl, u32 pin) where 'pin' must be a valid pin value (i.e. matching some 'groups->pin'). Fix the current implementation which uses some wrong 'pin' value. Fixes: e2f3cf1 ("pinctrl: stm32: add suspend/resume management") Signed-off-by: Fabien Dessenne <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 6dba4bd commit c370bb4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pinctrl/stm32/pinctrl-stm32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,8 +1644,8 @@ int __maybe_unused stm32_pinctrl_resume(struct device *dev)
16441644
struct stm32_pinctrl_group *g = pctl->groups;
16451645
int i;
16461646

1647-
for (i = g->pin; i < g->pin + pctl->ngroups; i++)
1648-
stm32_pinctrl_restore_gpio_regs(pctl, i);
1647+
for (i = 0; i < pctl->ngroups; i++, g++)
1648+
stm32_pinctrl_restore_gpio_regs(pctl, g->pin);
16491649

16501650
return 0;
16511651
}

0 commit comments

Comments
 (0)