leds: as3645a: Fix error return code in as3645a_parse_node()

[ Upstream commit 96a30960a2c5246c8ffebe8a3c9031f9df094d97 ]

Return error code -ENODEV rather than '0' when the indicator node can not
be found.

Fixes: a56ba8fbcb ("media: leds: as3645a: Add LED flash class driver")
Reported-by: Hulk Robot <[email protected]>
Acked-by: Sakari Ailus <[email protected]>
Signed-off-by: Zhen Lei <[email protected]>
Signed-off-by: Pavel Machek <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
Zhen Lei 2021-05-15 11:06:46 +08:00 • committed by Greg Kroah-Hartman
commit 95288e28c7

View file

@ -544,6 +544,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;
}