summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-05-10 12:50:39 +0300
committerPavel Machek <pavel@ucw.cz>2021-05-28 12:00:15 +0200
commit807553f8bf4afa673750e52905e0f9488179112f (patch)
treed01b0baa5819bcb30b489a44a6587f8599b9c23e /drivers/leds
parentf55db1c7fadc2a29c9fa4ff3aec98dbb111f2206 (diff)
downloadlinux-807553f8bf4afa673750e52905e0f9488179112f.tar.gz
linux-807553f8bf4afa673750e52905e0f9488179112f.tar.xz
leds: lm3697: Don't spam logs when probe is deferred
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>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-lm3697.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/leds/leds-lm3697.c b/drivers/leds/leds-lm3697.c
index 0d10d1213447..970a4f34791b 100644
--- a/drivers/leds/leds-lm3697.c
+++ b/drivers/leds/leds-lm3697.c
@@ -207,11 +207,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))