Commit 22cb0a76 authored by Sakari Ailus's avatar Sakari Ailus Committed by Pavel Machek

leds-as3645a: Drop fwnode reference on ignored node

If a node is ignored, do not get a reference to it. Fix the bug by moving
fwnode_handle_get() where a reference to an fwnode is saved for clarity.
Reported-by: default avatarAndy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent 90a8e82d
...@@ -493,16 +493,17 @@ static int as3645a_parse_node(struct as3645a *flash, ...@@ -493,16 +493,17 @@ static int as3645a_parse_node(struct as3645a *flash,
switch (id) { switch (id) {
case AS_LED_FLASH: case AS_LED_FLASH:
flash->flash_node = child; flash->flash_node = child;
fwnode_handle_get(child);
break; break;
case AS_LED_INDICATOR: case AS_LED_INDICATOR:
flash->indicator_node = child; flash->indicator_node = child;
fwnode_handle_get(child);
break; break;
default: default:
dev_warn(&flash->client->dev, dev_warn(&flash->client->dev,
"unknown LED %u encountered, ignoring\n", id); "unknown LED %u encountered, ignoring\n", id);
break; break;
} }
fwnode_handle_get(child);
} }
if (!flash->flash_node) { if (!flash->flash_node) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment