* [PATCH -next] pinctrl: stm32: Switch to use dev_err_probe() helper
@ 2022-09-17 12:20 Yang Yingliang
2022-09-20 9:17 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2022-09-17 12:20 UTC (permalink / raw)
To: linux-gpio; +Cc: linus.walleij, mcoquelin.stm32, fabien.dessenne, yangyingliang
In the probe path, dev_err() can be replace with dev_err_probe()
which will check if error code is -EPROBE_DEFER and prints the
error name.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/pinctrl/stm32/pinctrl-stm32.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index 14bcca73238a..e485506ea599 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -1603,10 +1603,9 @@ int stm32_pctl_probe(struct platform_device *pdev)
bank->clk = of_clk_get_by_name(np, NULL);
if (IS_ERR(bank->clk)) {
- if (PTR_ERR(bank->clk) != -EPROBE_DEFER)
- dev_err(dev, "failed to get clk (%ld)\n", PTR_ERR(bank->clk));
fwnode_handle_put(child);
- return PTR_ERR(bank->clk);
+ return dev_err_probe(dev, PTR_ERR(bank->clk),
+ "failed to get clk\n");
}
i++;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] pinctrl: stm32: Switch to use dev_err_probe() helper
2022-09-17 12:20 [PATCH -next] pinctrl: stm32: Switch to use dev_err_probe() helper Yang Yingliang
@ 2022-09-20 9:17 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2022-09-20 9:17 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-gpio, mcoquelin.stm32, fabien.dessenne
On Sat, Sep 17, 2022 at 2:13 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 prints the
> error name.
>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Patch applied as obviously correct. Thanks!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-20 9:17 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:20 [PATCH -next] pinctrl: stm32: Switch to use dev_err_probe() helper Yang Yingliang
2022-09-20 9:17 ` 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.