leds: ktd2692: Avoid duplicate error messages on probe deferral
Use dev_err_probe instead of dev_err to avoid duplicate error messages if the GPIO allocation makes the probe defer. Signed-off-by: Markuss Broks <markuss.broks@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
This commit is contained in:
parent
e1347bd4ab
commit
1d3b5aaaa4
@ -279,17 +279,13 @@ static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev,
|
||||
|
||||
led->ctrl_gpio = devm_gpiod_get(dev, "ctrl", GPIOD_ASIS);
|
||||
ret = PTR_ERR_OR_ZERO(led->ctrl_gpio);
|
||||
if (ret) {
|
||||
dev_err(dev, "cannot get ctrl-gpios %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "cannot get ctrl-gpios\n");
|
||||
|
||||
led->aux_gpio = devm_gpiod_get(dev, "aux", GPIOD_ASIS);
|
||||
ret = PTR_ERR_OR_ZERO(led->aux_gpio);
|
||||
if (ret) {
|
||||
dev_err(dev, "cannot get aux-gpios %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
if (ret)
|
||||
return dev_err_probe(dev, PTR_ERR(led->aux_gpio), "cannot get aux-gpios\n");
|
||||
|
||||
led->regulator = devm_regulator_get(dev, "vin");
|
||||
if (IS_ERR(led->regulator))
|
||||
|
Loading…
Reference in New Issue
Block a user