* [PATCH -next] pinctrl: sunxi: sun50i-h5: Switch to use dev_err_probe() helper
@ 2022-09-17 12:22 Yang Yingliang
2022-09-20 9:18 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2022-09-17 12:22 UTC (permalink / raw)
To: linux-gpio; +Cc: linus.walleij, wens, yangyingliang
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(-)
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:
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] pinctrl: sunxi: sun50i-h5: Switch to use dev_err_probe() helper
2022-09-17 12:22 [PATCH -next] pinctrl: sunxi: sun50i-h5: Switch to use dev_err_probe() helper Yang Yingliang
@ 2022-09-20 9:18 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2022-09-20 9:18 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-gpio, wens
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-20 9:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17 12:22 [PATCH -next] pinctrl: sunxi: sun50i-h5: Switch to use dev_err_probe() helper Yang Yingliang
2022-09-20 9:18 ` Linus Walleij
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.