Skip to content

Commit

Permalink
leds: ktd2692: Drop calling dev_of_node() in ktd2692_parse_dt
Browse files Browse the repository at this point in the history
output of dev_of_node() is already assigned to "np" variable in
ktd2692_parse_dt(). Use "np" variable to check if OF node is NULL
instead of calling dev_of_node() again.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
  • Loading branch information
Lad Prabhakar authored and Pavel Machek committed Jan 12, 2022
1 parent 2702c9b commit a05f5d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/leds/flash/leds-ktd2692.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev,
struct device_node *child_node;
int ret;

if (!dev_of_node(dev))
if (!np)
return -ENXIO;

led->ctrl_gpio = devm_gpiod_get(dev, "ctrl", GPIOD_ASIS);
Expand Down

0 comments on commit a05f5d0

Please sign in to comment.