Skip to content

Commit 1d3b5aa

Browse files
nergzd723pavelmachek
authored andcommitted
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 <[email protected]> Signed-off-by: Pavel Machek <[email protected]>
1 parent e1347bd commit 1d3b5aa

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/leds/flash/leds-ktd2692.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,17 +279,13 @@ static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev,
279279

280280
led->ctrl_gpio = devm_gpiod_get(dev, "ctrl", GPIOD_ASIS);
281281
ret = PTR_ERR_OR_ZERO(led->ctrl_gpio);
282-
if (ret) {
283-
dev_err(dev, "cannot get ctrl-gpios %d\n", ret);
284-
return ret;
285-
}
282+
if (ret)
283+
return dev_err_probe(dev, ret, "cannot get ctrl-gpios\n");
286284

287285
led->aux_gpio = devm_gpiod_get(dev, "aux", GPIOD_ASIS);
288286
ret = PTR_ERR_OR_ZERO(led->aux_gpio);
289-
if (ret) {
290-
dev_err(dev, "cannot get aux-gpios %d\n", ret);
291-
return ret;
292-
}
287+
if (ret)
288+
return dev_err_probe(dev, PTR_ERR(led->aux_gpio), "cannot get aux-gpios\n");
293289

294290
led->regulator = devm_regulator_get(dev, "vin");
295291
if (IS_ERR(led->regulator))

0 commit comments

Comments
 (0)