aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-sprd.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <[email protected]>2020-08-26 14:47:46 +0000
committerThierry Reding <[email protected]>2020-09-24 07:18:11 +0000
commit793bb636f549da85d1fe68228428e5e11d7db22e (patch)
tree635c6a19fe3bdb44f3487a1602e2c98ea5ece9bb /drivers/pwm/pwm-sprd.c
parentpwm: sifive: Simplify with dev_err_probe() (diff)
downloadkernel-793bb636f549da85d1fe68228428e5e11d7db22e.tar.gz
kernel-793bb636f549da85d1fe68228428e5e11d7db22e.zip
pwm: sprd: 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: Chunyan Zhang <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
Diffstat (limited to 'drivers/pwm/pwm-sprd.c')
-rw-r--r--drivers/pwm/pwm-sprd.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/pwm/pwm-sprd.c b/drivers/pwm/pwm-sprd.c
index be2394227423..5123d948efd6 100644
--- a/drivers/pwm/pwm-sprd.c
+++ b/drivers/pwm/pwm-sprd.c
@@ -228,11 +228,8 @@ static int sprd_pwm_clk_init(struct sprd_pwm_chip *spc)
if (ret == -ENOENT)
break;
- if (ret != -EPROBE_DEFER)
- dev_err(spc->dev,
- "failed to get channel clocks\n");
-
- return ret;
+ return dev_err_probe(spc->dev, ret,
+ "failed to get channel clocks\n");
}
clk_pwm = chn->clks[SPRD_PWM_CHN_OUTPUT_CLK].clk;