forked from luck/tmp_suning_uos_patched
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 <krzk@kernel.org> Acked-by: Palmer Dabbelt <palmerdabbelt@google.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
836719f894
commit
5530fcaf9c
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user