Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andy Shevchenko and committed by
Pavel Machek
807553f8 f55db1c7

+3 -5
+3 -5
drivers/leds/leds-lm3697.c
··· 207 207 208 208 priv->enable_gpio = devm_gpiod_get_optional(dev, "enable", 209 209 GPIOD_OUT_LOW); 210 - if (IS_ERR(priv->enable_gpio)) { 211 - ret = PTR_ERR(priv->enable_gpio); 212 - dev_err(dev, "Failed to get enable gpio: %d\n", ret); 213 - return ret; 214 - } 210 + if (IS_ERR(priv->enable_gpio)) 211 + return dev_err_probe(dev, PTR_ERR(priv->enable_gpio), 212 + "Failed to get enable GPIO\n"); 215 213 216 214 priv->regulator = devm_regulator_get(dev, "vled"); 217 215 if (IS_ERR(priv->regulator))