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: 5c1d824cda ("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>
This commit is contained in:
Andy Shevchenko 2021-05-10 12:50:39 +03:00 коммит произвёл Pavel Machek
Родитель f55db1c7fa
Коммит 807553f8bf
1 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

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