Commit 0045028f authored by Andy Shevchenko's avatar Andy Shevchenko

pinctrl/rockchip: Convert to use dev_err_probe()

It's fine to call dev_err_probe() in ->probe() when error code is known.
Convert the driver to use dev_err_probe().
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarHeiko Stuebner <heiko@sntech.de>
parent fb17dcd7
...@@ -2331,10 +2331,8 @@ static int rockchip_pinctrl_parse_groups(struct device_node *np, ...@@ -2331,10 +2331,8 @@ static int rockchip_pinctrl_parse_groups(struct device_node *np,
list = of_get_property(np, "rockchip,pins", &size); list = of_get_property(np, "rockchip,pins", &size);
/* we do not check return since it's safe node passed down */ /* we do not check return since it's safe node passed down */
size /= sizeof(*list); size /= sizeof(*list);
if (!size || size % 4) { if (!size || size % 4)
dev_err(dev, "wrong pins number or pins and configs should be by 4\n"); return dev_err_probe(dev, -EINVAL, "wrong pins number or pins and configs should be by 4\n");
return -EINVAL;
}
grp->npins = size / 4; grp->npins = size / 4;
...@@ -2489,10 +2487,8 @@ static int rockchip_pinctrl_register(struct platform_device *pdev, ...@@ -2489,10 +2487,8 @@ static int rockchip_pinctrl_register(struct platform_device *pdev,
return ret; return ret;
info->pctl_dev = devm_pinctrl_register(dev, ctrldesc, info); info->pctl_dev = devm_pinctrl_register(dev, ctrldesc, info);
if (IS_ERR(info->pctl_dev)) { if (IS_ERR(info->pctl_dev))
dev_err(dev, "could not register pinctrl driver\n"); return dev_err_probe(dev, PTR_ERR(info->pctl_dev), "could not register pinctrl driver\n");
return PTR_ERR(info->pctl_dev);
}
return 0; return 0;
} }
...@@ -2673,10 +2669,8 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev) ...@@ -2673,10 +2669,8 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
void __iomem *base; void __iomem *base;
int ret; int ret;
if (!dev->of_node) { if (!dev->of_node)
dev_err(dev, "device tree node not found\n"); return dev_err_probe(dev, -ENODEV, "device tree node not found\n");
return -ENODEV;
}
info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
if (!info) if (!info)
...@@ -2685,10 +2679,8 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev) ...@@ -2685,10 +2679,8 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
info->dev = dev; info->dev = dev;
ctrl = rockchip_pinctrl_get_soc_data(info, pdev); ctrl = rockchip_pinctrl_get_soc_data(info, pdev);
if (!ctrl) { if (!ctrl)
dev_err(dev, "driver data not available\n"); return dev_err_probe(dev, -EINVAL, "driver data not available\n");
return -EINVAL;
}
info->ctrl = ctrl; info->ctrl = ctrl;
node = of_parse_phandle(np, "rockchip,grf", 0); node = of_parse_phandle(np, "rockchip,grf", 0);
...@@ -2737,10 +2729,8 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev) ...@@ -2737,10 +2729,8 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, info); platform_set_drvdata(pdev, info);
ret = of_platform_populate(np, rockchip_bank_match, NULL, NULL); ret = of_platform_populate(np, rockchip_bank_match, NULL, NULL);
if (ret) { if (ret)
dev_err(dev, "failed to register gpio device\n"); return dev_err_probe(dev, ret, "failed to register gpio device\n");
return ret;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment