]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
leds: lm3697: Don't spam logs when probe is deferred
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 10 May 2021 09:50:39 +0000 (12:50 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 15:00:16 +0000 (17:00 +0200)
[ Upstream commit 807553f8bf4afa673750e52905e0f9488179112f ]

When requesting GPIO line the probe can be deferred.
In such case don't spam logs with an error message.
This can be achieved by switching to dev_err_probe().

Fixes: 5c1d824cda9f ("leds: lm3697: Introduce the lm3697 driver")
Cc: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/leds/leds-lm3697.c

index 7d216cdb91a8abe587d2d9ad1e72ff8260595f4b..912e8bb22a9953db2f8a44f9b73d9e258693bdb2 100644 (file)
@@ -203,11 +203,9 @@ static int lm3697_probe_dt(struct lm3697 *priv)
 
        priv->enable_gpio = devm_gpiod_get_optional(dev, "enable",
                                                    GPIOD_OUT_LOW);
-       if (IS_ERR(priv->enable_gpio)) {
-               ret = PTR_ERR(priv->enable_gpio);
-               dev_err(dev, "Failed to get enable gpio: %d\n", ret);
-               return ret;
-       }
+       if (IS_ERR(priv->enable_gpio))
+               return dev_err_probe(dev, PTR_ERR(priv->enable_gpio),
+                                         "Failed to get enable GPIO\n");
 
        priv->regulator = devm_regulator_get(dev, "vled");
        if (IS_ERR(priv->regulator))