mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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 <krzk@kernel.org> Acked-by: Chunyan Zhang <zhang.lyra@gmail.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
parent
5530fcaf9c
commit
793bb636f5
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user