watchdog: cadence: Do not show error in case of deferred probe
diff mbox series

Message ID d3e295d5ba79f453b4aa4128c4fa63fbd6c16920.1570544944.git.michal.simek@xilinx.com
State Accepted
Headers show
Series
  • watchdog: cadence: Do not show error in case of deferred probe
Related show

Commit Message

Michal Simek Oct. 8, 2019, 2:29 p.m. UTC
There is no reason to show error message if clocks are not ready yet.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/watchdog/cadence_wdt.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Guenter Roeck Oct. 8, 2019, 3:22 p.m. UTC | #1
On Tue, Oct 08, 2019 at 04:29:10PM +0200, Michal Simek wrote:
> There is no reason to show error message if clocks are not ready yet.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
> 
>  drivers/watchdog/cadence_wdt.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index 76d855ce25f3..672b184da875 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -335,8 +335,10 @@ static int cdns_wdt_probe(struct platform_device *pdev)
>  
>  	wdt->clk = devm_clk_get(dev, NULL);
>  	if (IS_ERR(wdt->clk)) {
> -		dev_err(dev, "input clock not found\n");
> -		return PTR_ERR(wdt->clk);
> +		ret = PTR_ERR(wdt->clk);
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(dev, "input clock not found\n");
> +		return ret;
>  	}
>  
>  	ret = clk_prepare_enable(wdt->clk);
> -- 
> 2.17.1
>

Patch
diff mbox series

diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index 76d855ce25f3..672b184da875 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -335,8 +335,10 @@  static int cdns_wdt_probe(struct platform_device *pdev)
 
 	wdt->clk = devm_clk_get(dev, NULL);
 	if (IS_ERR(wdt->clk)) {
-		dev_err(dev, "input clock not found\n");
-		return PTR_ERR(wdt->clk);
+		ret = PTR_ERR(wdt->clk);
+		if (ret != -EPROBE_DEFER)
+			dev_err(dev, "input clock not found\n");
+		return ret;
 	}
 
 	ret = clk_prepare_enable(wdt->clk);