Skip to content

Commit 6917578

Browse files
nergzd723pavelmachek
authored andcommitted
leds: ktd2692: Make aux-gpios optional
Make the AUX pin optional, since it isn't a core part of functionality, and the device is designed to be operational with only one CTRL pin. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Markuss Broks <[email protected]> Signed-off-by: Pavel Machek <[email protected]>
1 parent 92db043 commit 6917578

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/leds/flash/leds-ktd2692.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,8 @@ static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev,
282282
if (ret)
283283
return dev_err_probe(dev, ret, "cannot get ctrl-gpios\n");
284284

285-
led->aux_gpio = devm_gpiod_get(dev, "aux", GPIOD_ASIS);
286-
ret = PTR_ERR_OR_ZERO(led->aux_gpio);
287-
if (ret)
285+
led->aux_gpio = devm_gpiod_get_optional(dev, "aux", GPIOD_ASIS);
286+
if (IS_ERR(led->aux_gpio))
288287
return dev_err_probe(dev, PTR_ERR(led->aux_gpio), "cannot get aux-gpios\n");
289288

290289
led->regulator = devm_regulator_get(dev, "vin");

0 commit comments

Comments
 (0)