Skip to content

Commit

Permalink
pinctrl: mt7622: Fix probe fail by misuse the selector
Browse files Browse the repository at this point in the history
After the commit acf1379 ("pinctrl: core: Return selector to the
pinctrl driver") and the commit 47f1242 ("pinctrl: pinmux: Return
selector to the pinctrl driver"), it's necessary to add the fixes
needed for the pin controller drivers to use the appropriate returned
selector for a negative error number returned in case of the fail at
these functions. Otherwise, the driver would have a failed probe and
that causes boot message cannot correctly output and devices fail
to acquire their own pins.

Cc: Kevin Hilman <[email protected]>
Fixes: acf1379 ("pinctrl: core: Return selector to the pinctrl driver")
Fixes: 47f1242 ("pinctrl: pinmux: Return selector to the pinctrl driver")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
moore-bros authored and linusw committed Jul 17, 2018
1 parent 673ba5a commit 238262a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pinctrl/mediatek/pinctrl-mt7622.c
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ static int mtk_build_groups(struct mtk_pinctrl *hw)
err = pinctrl_generic_add_group(hw->pctrl, group->name,
group->pins, group->num_pins,
group->data);
if (err) {
if (err < 0) {
dev_err(hw->dev, "Failed to register group %s\n",
group->name);
return err;
Expand All @@ -1546,7 +1546,7 @@ static int mtk_build_functions(struct mtk_pinctrl *hw)
func->group_names,
func->num_group_names,
func->data);
if (err) {
if (err < 0) {
dev_err(hw->dev, "Failed to register function %s\n",
func->name);
return err;
Expand Down

0 comments on commit 238262a

Please sign in to comment.