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:
Krzysztof Kozlowski 2020-08-26 16:47:46 +02:00 коммит произвёл Thierry Reding
Родитель 5530fcaf9c
Коммит 793bb636f5
1 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

@ -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;