watchdog: davinci: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200901153141.18960-2-krzk@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
This commit is contained in:
Krzysztof Kozlowski
2020-09-01 17:31:40 +02:00
committed by Wim Van Sebroeck
parent dab1122159
commit fc77204001
+3 -6
View File
@@ -206,12 +206,9 @@ static int davinci_wdt_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
davinci_wdt->clk = devm_clk_get(dev, NULL); davinci_wdt->clk = devm_clk_get(dev, NULL);
if (IS_ERR(davinci_wdt->clk))
if (IS_ERR(davinci_wdt->clk)) { return dev_err_probe(dev, PTR_ERR(davinci_wdt->clk),
if (PTR_ERR(davinci_wdt->clk) != -EPROBE_DEFER) "failed to get clock node\n");
dev_err(dev, "failed to get clock node\n");
return PTR_ERR(davinci_wdt->clk);
}
ret = clk_prepare_enable(davinci_wdt->clk); ret = clk_prepare_enable(davinci_wdt->clk);
if (ret) { if (ret) {