[1/1] leds: as3645a: Fix error return code in as3645a_parse_node()

Message ID 20210515030646.6877-1-thunder.leizhen@huawei.com
State New
Headers show
Series
  • [1/1] leds: as3645a: Fix error return code in as3645a_parse_node()
Related show

Commit Message

Zhen Lei May 15, 2021, 3:06 a.m.
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>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

---
 drivers/leds/leds-as3645a.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.26.0.106.g9fadedd

Comments

Sakari Ailus May 25, 2021, 4:42 p.m. | #1
On Sat, May 15, 2021 at 11:06:46AM +0800, Zhen Lei wrote:
> 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>

> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>


Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>


-- 
Sakari Ailus
Pavel Machek June 23, 2021, 8:15 p.m. | #2
On Sat 2021-05-15 11:06:46, Zhen Lei wrote:
> 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>

> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>


Thanks, applied.
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

Patch

diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
index e8922fa03379620..80411d41e802d46 100644
--- a/drivers/leds/leds-as3645a.c
+++ b/drivers/leds/leds-as3645a.c
@@ -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;
 	}