pinctrl: core: Do not add device links for hogs

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>
This commit is contained in:
Linus Walleij 2019-05-24 00:11:43 +02:00
parent c6045b4e3c
commit b672a87ae5
1 changed files with 3 additions and 1 deletions

View File

@ -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;