diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2022-09-17 15:20:15 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2022-09-20 12:16:42 +0300 |
commit | 790cf9e3da3f16d65d389d714f6e18f27cf18704 (patch) | |
tree | 44ced9b52fcd5978c99e0e28437eb79a79957110 /drivers/pinctrl/stm32 | |
parent | a72be048b71c10475d169d3951c49fb8a6a803e3 (diff) | |
download | linux-790cf9e3da3f16d65d389d714f6e18f27cf18704.tar.xz |
pinctrl: stm32: Switch to use dev_err_probe() helper
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>
Link: https://lore.kernel.org/r/20220917122015.1893880-1-yangyingliang@huawei.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/stm32')
-rw-r--r-- | drivers/pinctrl/stm32/pinctrl-stm32.c | 5 |
1 files 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++; } |