summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>2021-12-13 20:03:31 +0100
committerPavel Machek <pavel@ucw.cz>2022-01-12 19:43:15 +0100
commita05f5d0e6aebd5c562d7f61b0fd3904d3e3994d1 (patch)
tree29a70c99c491558904b8962492ade1fa862e6a8e /drivers/leds
parentleds: lgm-sso: Get rid of duplicate of_node assignment (diff)
downloadlinux-a05f5d0e6aebd5c562d7f61b0fd3904d3e3994d1.tar.xz
linux-a05f5d0e6aebd5c562d7f61b0fd3904d3e3994d1.zip
leds: ktd2692: Drop calling dev_of_node() in ktd2692_parse_dt
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>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/flash/leds-ktd2692.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/leds/flash/leds-ktd2692.c b/drivers/leds/flash/leds-ktd2692.c
index f341da1503a4..ed1f20a58bf6 100644
--- a/drivers/leds/flash/leds-ktd2692.c
+++ b/drivers/leds/flash/leds-ktd2692.c
@@ -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);