pwm: imx: Don't print an error on -EPROBE_DEFER
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 7 Jan 2019 19:53:51 +0000 (20:53 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 10 Jan 2019 08:40:58 +0000 (09:40 +0100)
When getting the peripheral clock fails with -EPROBE_DEFER the driver is
usually probed again later and emitting an error message is irritating.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-imx.c

index 809493d86d223414afb688dcec382aaf7b8b878a..30380fcb5cfb6b8b5c387e7f3c7e02d289b908d6 100644 (file)
@@ -411,9 +411,14 @@ static int imx_pwm_probe(struct platform_device *pdev)
 
        imx->clk_per = devm_clk_get(&pdev->dev, "per");
        if (IS_ERR(imx->clk_per)) {
-               dev_err(&pdev->dev, "getting per clock failed with %ld\n",
-                               PTR_ERR(imx->clk_per));
-               return PTR_ERR(imx->clk_per);
+               int ret = PTR_ERR(imx->clk_per);
+
+               if (ret != -EPROBE_DEFER)
+                       dev_err(&pdev->dev,
+                               "failed to get peripheral clock: %d\n",
+                               ret);
+
+               return ret;
        }
 
        imx->chip.ops = data->ops;