Input: pwm-beeper - suppress error message on probe defer
authorDavid Lechner <david@lechnology.com>
Fri, 6 Jan 2017 18:35:16 +0000 (10:35 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 22 Jan 2017 08:23:20 +0000 (00:23 -0800)
This suppress printing an error message when pwm_get returns -EPROBE_DEFER.
Otherwise you get a bunch of noise in the kernel log.

Signed-off-by: David Lechner <david@lechnology.com>
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/pwm-beeper.c

index 9d7987d9ba1b0a9b09e0f98b8bc2e401d7890511..069d594554bda7bf475df80f396a66dcbbca9123 100644 (file)
@@ -108,7 +108,9 @@ static int pwm_beeper_probe(struct platform_device *pdev)
        beeper->pwm = devm_pwm_get(dev, NULL);
        if (IS_ERR(beeper->pwm)) {
                error = PTR_ERR(beeper->pwm);
-               dev_err(dev, "Failed to request PWM device: %d\n", error);
+               if (error != -EPROBE_DEFER)
+                       dev_err(dev, "Failed to request PWM device: %d\n",
+                               error);
                return error;
        }