Commit d342951b authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Wim Van Sebroeck

watchdog: rti: 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: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200901153141.18960-3-krzk@kernel.orgSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent fc772040
...@@ -205,11 +205,8 @@ static int rti_wdt_probe(struct platform_device *pdev) ...@@ -205,11 +205,8 @@ static int rti_wdt_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
clk = clk_get(dev, NULL); clk = clk_get(dev, NULL);
if (IS_ERR(clk)) { if (IS_ERR(clk))
if (PTR_ERR(clk) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(clk), "failed to get clock\n");
dev_err(dev, "failed to get clock\n");
return PTR_ERR(clk);
}
wdt->freq = clk_get_rate(clk); wdt->freq = clk_get_rate(clk);
...@@ -230,11 +227,8 @@ static int rti_wdt_probe(struct platform_device *pdev) ...@@ -230,11 +227,8 @@ static int rti_wdt_probe(struct platform_device *pdev)
pm_runtime_enable(dev); pm_runtime_enable(dev);
ret = pm_runtime_get_sync(dev); ret = pm_runtime_get_sync(dev);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(dev, ret, "runtime pm failed\n");
dev_err(&pdev->dev, "runtime pm failed\n");
return ret;
}
platform_set_drvdata(pdev, wdt); platform_set_drvdata(pdev, wdt);
......
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