aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-sifive.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <[email protected]>2020-08-26 14:47:45 +0000
committerThierry Reding <[email protected]>2020-09-24 07:18:11 +0000
commit5530fcaf9ca30b85cfe03c6fb98ec1b1ea189e6d (patch)
tree22df076ffe0a3d31ba497577a9fdb94ed4f5bfef /drivers/pwm/pwm-sifive.c
parentpwm: rockchip: Simplify with dev_err_probe() (diff)
downloadkernel-5530fcaf9ca30b85cfe03c6fb98ec1b1ea189e6d.tar.gz
kernel-5530fcaf9ca30b85cfe03c6fb98ec1b1ea189e6d.zip
pwm: sifive: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski <[email protected]> Acked-by: Palmer Dabbelt <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
Diffstat (limited to 'drivers/pwm/pwm-sifive.c')
-rw-r--r--drivers/pwm/pwm-sifive.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/pwm/pwm-sifive.c b/drivers/pwm/pwm-sifive.c
index 62de0bb85921..2485fbaaead2 100644
--- a/drivers/pwm/pwm-sifive.c
+++ b/drivers/pwm/pwm-sifive.c
@@ -254,11 +254,9 @@ static int pwm_sifive_probe(struct platform_device *pdev)
return PTR_ERR(ddata->regs);
ddata->clk = devm_clk_get(dev, NULL);
- if (IS_ERR(ddata->clk)) {
- if (PTR_ERR(ddata->clk) != -EPROBE_DEFER)
- dev_err(dev, "Unable to find controller clock\n");
- return PTR_ERR(ddata->clk);
- }
+ if (IS_ERR(ddata->clk))
+ return dev_err_probe(dev, PTR_ERR(ddata->clk),
+ "Unable to find controller clock\n");
ret = clk_prepare_enable(ddata->clk);
if (ret) {