Commit 793bb636 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Thierry Reding

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: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Acked-by: default avatarChunyan Zhang <zhang.lyra@gmail.com>
Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 5530fcaf
...@@ -228,11 +228,8 @@ static int sprd_pwm_clk_init(struct sprd_pwm_chip *spc) ...@@ -228,11 +228,8 @@ static int sprd_pwm_clk_init(struct sprd_pwm_chip *spc)
if (ret == -ENOENT) if (ret == -ENOENT)
break; break;
if (ret != -EPROBE_DEFER) return dev_err_probe(spc->dev, ret,
dev_err(spc->dev, "failed to get channel clocks\n");
"failed to get channel clocks\n");
return ret;
} }
clk_pwm = chn->clks[SPRD_PWM_CHN_OUTPUT_CLK].clk; clk_pwm = chn->clks[SPRD_PWM_CHN_OUTPUT_CLK].clk;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment