@@ -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;
}
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@rock-chips.com> --- drivers/pinctrl/pinctrl-rockchip.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)