Commit 5530fcaf authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Thierry Reding

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: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Acked-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 836719f8
......@@ -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) {
......
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