pwm: Silently error out on EPROBE_DEFER
authorJerome Brunet <jbrunet@baylibre.com>
Tue, 23 May 2017 16:05:03 +0000 (18:05 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 6 Jul 2017 06:29:16 +0000 (08:29 +0200)
In of_pwm_get(), if we fail to get the PWM chip due to probe deferal, we
shouldn't print an error message. Just be silent in this case.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/core.c

index a0860b3..1581f6a 100644 (file)
@@ -678,7 +678,9 @@ struct pwm_device *of_pwm_get(struct device_node *np, const char *con_id)
 
        pc = of_node_to_pwmchip(args.np);
        if (IS_ERR(pc)) {
-               pr_err("%s(): PWM chip not found\n", __func__);
+               if (PTR_ERR(pc) != -EPROBE_DEFER)
+                       pr_err("%s(): PWM chip not found\n", __func__);
+
                pwm = ERR_CAST(pc);
                goto put;
        }