Skip to content

Commit 4ea4d48

Browse files
EHfivelinusw
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 <[email protected]> Signed-off-by: Huang-Huang Bao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 01b4b1d commit 4ea4d48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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)