Skip to content

Commit 4ea4d48

Browse files
EHfiveLinus Walleij
authored andcommitted
pinctrl: rockchip: fix pinmux reset in rockchip_pmx_set
rockchip_pmx_set reset all pinmuxs in group to 0 in the case of error, add missing bank data retrieval in that code to avoid setting mux on unexpected pins. Fixes: 1479718 ("pinctrl: rockchip: add return value to rockchip_set_mux") Reviewed-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Huang-Huang Bao <i@eh5.me> Link: https://lore.kernel.org/r/20240606125755.53778-5-i@eh5.me Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 01b4b1d commit 4ea4d48

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/pinctrl/pinctrl-rockchip.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2751,8 +2751,10 @@ static int rockchip_pmx_set(struct pinctrl_dev *pctldev, unsigned selector,
27512751

27522752
if (ret) {
27532753
/* revert the already done pin settings */
2754-
for (cnt--; cnt >= 0; cnt--)
2754+
for (cnt--; cnt >= 0; cnt--) {
2755+
bank = pin_to_bank(info, pins[cnt]);
27552756
rockchip_set_mux(bank, pins[cnt] - bank->pin_base, 0);
2757+
}
27562758

27572759
return ret;
27582760
}

0 commit comments

Comments
 (0)