Skip to content

Commit

Permalink
pinctrl: core: Do not add device links for hogs
Browse files Browse the repository at this point in the history
Hogs would create circular device links, so do not link
the device to itself.

Cc: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Linus Walleij committed May 24, 2019
1 parent c6045b4 commit b672a87
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/pinctrl/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,9 @@ static int pinctrl_commit_state(struct pinctrl *p, struct pinctrl_state *state)
goto unapply_new_state;
}

pinctrl_link_add(setting->pctldev, p->dev);
/* Do not link hogs (circular dependency) */
if (p != setting->pctldev->p)
pinctrl_link_add(setting->pctldev, p->dev);
}

p->state = state;
Expand Down

0 comments on commit b672a87

Please sign in to comment.