Message ID | 20220917122208.1894769-1-yangyingliang@huawei.com |
---|---|
State | Accepted |
Commit | 35b871f72a5a06dc5a328427a437797ad99c0696 |
Headers | show |
Series | [-next] pinctrl: sunxi: sun50i-h5: Switch to use dev_err_probe() helper | expand |
On Sat, Sep 17, 2022 at 2:15 PM Yang Yingliang <yangyingliang@huawei.com> wrote: > In the probe path, dev_err() can be replace with dev_err_probe() > which will check if error code is -EPROBE_DEFER and and prints the > error name. > > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Patch applied! Yours, Linus Walleij
diff --git a/drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c b/drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c index 31d62bbb7f43..96a350e70668 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c +++ b/drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c @@ -551,12 +551,9 @@ static int sun50i_h5_pinctrl_probe(struct platform_device *pdev) int ret; ret = platform_irq_count(pdev); - if (ret < 0) { - if (ret != -EPROBE_DEFER) - dev_err(&pdev->dev, "Couldn't determine irq count: %pe\n", - ERR_PTR(ret)); - return ret; - } + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, + "Couldn't determine irq count\n"); switch (ret) { case 2:
In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER and and prints the error name. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)