Skip to content

Commit 790cf9e

Browse files
Yang Yinglianglinusw
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent a72be04 commit 790cf9e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/pinctrl/stm32/pinctrl-stm32.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,10 +1603,9 @@ int stm32_pctl_probe(struct platform_device *pdev)
16031603

16041604
bank->clk = of_clk_get_by_name(np, NULL);
16051605
if (IS_ERR(bank->clk)) {
1606-
if (PTR_ERR(bank->clk) != -EPROBE_DEFER)
1607-
dev_err(dev, "failed to get clk (%ld)\n", PTR_ERR(bank->clk));
16081606
fwnode_handle_put(child);
1609-
return PTR_ERR(bank->clk);
1607+
return dev_err_probe(dev, PTR_ERR(bank->clk),
1608+
"failed to get clk\n");
16101609
}
16111610
i++;
16121611
}

0 commit comments

Comments
 (0)