aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien Dessenne <fabien.dessenne@foss.st.com>2021-10-08 14:25:17 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-27 09:59:55 +0200
commit96e4ea34f6d7c3df2c8138656ccb7311633df04b (patch)
tree92b5089430124935a6bfef42498fdedcd4267dcc
parent4850e9e3c6a34f7e30a6d073629d98c826698033 (diff)
downloadlinux-yocto-96e4ea34f6d7c3df2c8138656ccb7311633df04b.tar.gz
linux-yocto-96e4ea34f6d7c3df2c8138656ccb7311633df04b.tar.bz2
linux-yocto-96e4ea34f6d7c3df2c8138656ccb7311633df04b.zip
pinctrl: stm32: use valid pin identifier in stm32_pinctrl_resume()
commit c370bb474016ab9edfdabd7c08a88dd13a71ddbd upstream. 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: e2f3cf18c3e2 ("pinctrl: stm32: add suspend/resume management") Signed-off-by: Fabien Dessenne <fabien.dessenne@foss.st.com> Link: https://lore.kernel.org/r/20211008122517.617633-1-fabien.dessenne@foss.st.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/pinctrl/stm32/pinctrl-stm32.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index 68b3886f9f0f..dfd8888a222a 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -1644,8 +1644,8 @@ int __maybe_unused stm32_pinctrl_resume(struct device *dev)
struct stm32_pinctrl_group *g = pctl->groups;
int i;
- for (i = g->pin; i < g->pin + pctl->ngroups; i++)
- stm32_pinctrl_restore_gpio_regs(pctl, i);
+ for (i = 0; i < pctl->ngroups; i++, g++)
+ stm32_pinctrl_restore_gpio_regs(pctl, g->pin);
return 0;
}