summaryrefslogtreecommitdiff
path: root/drivers/watchdog/cadence_wdt.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2020-09-01 17:31:39 +0200
committerWim Van Sebroeck <wim@linux-watchdog.org>2020-10-14 15:02:24 +0200
commitdab1122159a5e7be58e5f64099a8fe7d82ed834f (patch)
treee08f51948378bfb71967a382fdb87dbe7d7a81ad /drivers/watchdog/cadence_wdt.c
parent2c904630e9b18c58a2261193e6d85a3d79d87033 (diff)
watchdog: cadence: 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-1-krzk@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog/cadence_wdt.c')
-rw-r--r--drivers/watchdog/cadence_wdt.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index 672b184da875..bc99e9164930 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -334,12 +334,9 @@ static int cdns_wdt_probe(struct platform_device *pdev)
watchdog_set_drvdata(cdns_wdt_device, wdt);
wdt->clk = devm_clk_get(dev, NULL);
- if (IS_ERR(wdt->clk)) {
- ret = PTR_ERR(wdt->clk);
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "input clock not found\n");
- return ret;
- }
+ if (IS_ERR(wdt->clk))
+ return dev_err_probe(dev, PTR_ERR(wdt->clk),
+ "input clock not found\n");
ret = clk_prepare_enable(wdt->clk);
if (ret) {