leds: as3645a: Fix error return code in as3645a_parse_node()
authorZhen Lei <thunder.leizhen@huawei.com>
Sat, 15 May 2021 03:06:46 +0000 (11:06 +0800)
committerPavel Machek <pavel@ucw.cz>
Wed, 23 Jun 2021 20:14:39 +0000 (22:14 +0200)
Return error code -ENODEV rather than '0' when the indicator node can not
be found.

Fixes: a56ba8fbcb55 ("media: leds: as3645a: Add LED flash class driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
drivers/leds/leds-as3645a.c

index c41937f..aa3f82b 100644 (file)
@@ -545,6 +545,7 @@ static int as3645a_parse_node(struct as3645a *flash,
        if (!flash->indicator_node) {
                dev_warn(&flash->client->dev,
                         "can't find indicator node\n");
+               rval = -ENODEV;
                goto out_err;
        }