[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220920103108.23074-3-jay.xu@rock-chips.com>
Date: Tue, 20 Sep 2022 18:30:50 +0800
From: Jianqun Xu <jay.xu@...k-chips.com>
To: linus.walleij@...aro.org, heiko@...ech.de, brgl@...ev.pl,
andriy.shevchenko@...ux.intel.com
Cc: robert.moore@...el.com, robh@...nel.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
lenb@...nel.org, rafael@...nel.org,
Jianqun Xu <jay.xu@...k-chips.com>
Subject: [PATCH 02/20] pinctrl/rockchip: populate GPIO platform early
It is better to register GPIO devices before pinctrl device, so move the
populate GPIO platform early before pinctrl do really probe.
Signed-off-by: Jianqun Xu <jay.xu@...k-chips.com>
---
drivers/pinctrl/pinctrl-rockchip.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index a91061f9c2ac..25633c7b4244 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -3302,6 +3302,10 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
if (!dev->of_node)
return dev_err_probe(dev, -ENODEV, "device tree node not found\n");
+ ret = of_platform_populate(np, NULL, NULL, dev);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to register gpio device\n");
+
info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
@@ -3360,10 +3364,6 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, info);
- ret = of_platform_populate(np, NULL, NULL, &pdev->dev);
- if (ret)
- return dev_err_probe(dev, ret, "failed to register gpio device\n");
-
return 0;
}
--
2.25.1
Powered by blists - more mailing lists