leds: pwm: silently error out on EPROBE_DEFER
authorJerome Brunet <jbrunet@baylibre.com>
Thu, 6 Sep 2018 13:59:04 +0000 (15:59 +0200)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Sat, 8 Sep 2018 20:47:15 +0000 (22:47 +0200)
When probing, if we fail to get the pwm 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>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
drivers/leds/leds-pwm.c

index df80c89ebe7fac93fce0b323aa101b6b56d2e5d9..5d3faae51d59e6c3428ec17988a91a5458603ba0 100644 (file)
@@ -100,8 +100,9 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
                led_data->pwm = devm_pwm_get(dev, led->name);
        if (IS_ERR(led_data->pwm)) {
                ret = PTR_ERR(led_data->pwm);
-               dev_err(dev, "unable to request PWM for %s: %d\n",
-                       led->name, ret);
+               if (ret != -EPROBE_DEFER)
+                       dev_err(dev, "unable to request PWM for %s: %d\n",
+                               led->name, ret);
                return ret;
        }