Skip to content

Commit

Permalink
pinctrl: rockchip: fix pinmux reset in rockchip_pmx_set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
EHfive authored and linusw committed Jun 17, 2024
1 parent 01b4b1d commit 4ea4d48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/pinctrl/pinctrl-rockchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -2751,8 +2751,10 @@ static int rockchip_pmx_set(struct pinctrl_dev *pctldev, unsigned selector,

if (ret) {
/* revert the already done pin settings */
for (cnt--; cnt >= 0; cnt--)
for (cnt--; cnt >= 0; cnt--) {
bank = pin_to_bank(info, pins[cnt]);
rockchip_set_mux(bank, pins[cnt] - bank->pin_base, 0);
}

return ret;
}
Expand Down

0 comments on commit 4ea4d48

Please sign in to comment.