]> git.baikalelectronics.ru Git - kernel.git/commitdiff
leds: ktd2692: Drop calling dev_of_node() in ktd2692_parse_dt
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Mon, 13 Dec 2021 19:03:31 +0000 (19:03 +0000)
committerPavel Machek <pavel@ucw.cz>
Wed, 12 Jan 2022 18:43:15 +0000 (19:43 +0100)
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>
drivers/leds/flash/leds-ktd2692.c

index f341da1503a49287aa786ca23f476b2bbf90d7b2..ed1f20a58bf6dca98114762cf1b83ea4b1354263 100644 (file)
@@ -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);