From b672a87ae5ab0704364781214bb1251b75cbef1b Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Fri, 24 May 2019 00:11:43 +0200 Subject: [PATCH] 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 Signed-off-by: Linus Walleij --- drivers/pinctrl/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index d757c51..41adb4e 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -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; -- 2.7.4