@@ -3296,12 +3296,11 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
void __iomem *base;
int ret;
- if (!is_of_node(fwnode))
- 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");
+ if (is_of_node(fwnode)) {
+ 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)
As the of_populate_platform named with prefix "of_", it should be done only when the of node is exist. Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com> --- drivers/pinctrl/pinctrl-rockchip.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)