summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2013-08-20 20:16:21 +0400
committerLinus Walleij <linus.walleij@linaro.org>2013-08-23 10:56:31 +0400
commit529301c19cbc315929e1b39ee71859061910b652 (patch)
treec806d108e0f0c4331e06d80906a09045efe98d5e
parent736658c5ebc93743687c6f627c9317b97d26c5be (diff)
downloadlinux-529301c19cbc315929e1b39ee71859061910b652.tar.xz
pinctrl: samsung: Parse pin groups before calling pinctrl_register()
Calling pinctrl_register() means that the driver is fully initialized and might accept pinmux/pinconf requests, so pin groups must be parsed before. This patch fixes this problem by moving device tree parsing before call to pinctrl_register(). In addition, this fixes support for hogs on pin controllers handled by pinctrl-samsung driver. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/pinctrl-samsung.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c
index a7fa9e2d4751..439f2ef680df 100644
--- a/drivers/pinctrl/pinctrl-samsung.c
+++ b/drivers/pinctrl/pinctrl-samsung.c
@@ -767,6 +767,10 @@ static int samsung_pinctrl_register(struct platform_device *pdev,
}
}
+ ret = samsung_pinctrl_parse_dt(pdev, drvdata);
+ if (ret)
+ return ret;
+
drvdata->pctl_dev = pinctrl_register(ctrldesc, &pdev->dev, drvdata);
if (!drvdata->pctl_dev) {
dev_err(&pdev->dev, "could not register pinctrl driver\n");
@@ -784,12 +788,6 @@ static int samsung_pinctrl_register(struct platform_device *pdev,
pinctrl_add_gpio_range(drvdata->pctl_dev, &pin_bank->grange);
}
- ret = samsung_pinctrl_parse_dt(pdev, drvdata);
- if (ret) {
- pinctrl_unregister(drvdata->pctl_dev);
- return ret;
- }
-
return 0;
}