linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: sprd: Move DT parsing before registering pinctrl device
@ 2018-09-27  9:15 Baolin Wang
  2018-09-28  7:34 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Baolin Wang @ 2018-09-27  9:15 UTC (permalink / raw)
  To: linus.walleij, orsonzhai, zhang.lyra
  Cc: baolin.wang, broonie, linux-gpio, linux-kernel

It will be failed to select default or sleep state for pins hogged
by the pin controller device, since we hadn't parsed pins configuration
in device tree before registering the pin controller device. Thus
we should move the device tree parsing function before registering
the pin controller device.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 drivers/pinctrl/sprd/pinctrl-sprd.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c
index 78c2f54..4537b54 100644
--- a/drivers/pinctrl/sprd/pinctrl-sprd.c
+++ b/drivers/pinctrl/sprd/pinctrl-sprd.c
@@ -1059,6 +1059,12 @@ int sprd_pinctrl_core_probe(struct platform_device *pdev,
 		return ret;
 	}
 
+	ret = sprd_pinctrl_parse_dt(sprd_pctl);
+	if (ret) {
+		dev_err(&pdev->dev, "fail to parse dt properties\n");
+		return ret;
+	}
+
 	pin_desc = devm_kcalloc(&pdev->dev,
 				pinctrl_info->npins,
 				sizeof(struct pinctrl_pin_desc),
@@ -1083,13 +1089,6 @@ int sprd_pinctrl_core_probe(struct platform_device *pdev,
 		return PTR_ERR(sprd_pctl->pctl);
 	}
 
-	ret = sprd_pinctrl_parse_dt(sprd_pctl);
-	if (ret) {
-		dev_err(&pdev->dev, "fail to parse dt properties\n");
-		pinctrl_unregister(sprd_pctl->pctl);
-		return ret;
-	}
-
 	return 0;
 }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pinctrl: sprd: Move DT parsing before registering pinctrl device
  2018-09-27  9:15 [PATCH] pinctrl: sprd: Move DT parsing before registering pinctrl device Baolin Wang
@ 2018-09-28  7:34 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2018-09-28  7:34 UTC (permalink / raw)
  To: Baolin Wang
  Cc: orsonzhai, zhang.lyra, Mark Brown, open list:GPIO SUBSYSTEM,
	linux-kernel

On Thu, Sep 27, 2018 at 11:15 AM Baolin Wang <baolin.wang@linaro.org> wrote:

> It will be failed to select default or sleep state for pins hogged
> by the pin controller device, since we hadn't parsed pins configuration
> in device tree before registering the pin controller device. Thus
> we should move the device tree parsing function before registering
> the pin controller device.
>
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-28  7:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-27  9:15 [PATCH] pinctrl: sprd: Move DT parsing before registering pinctrl device Baolin Wang
2018-09-28  7:34 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).