leds-as3645a: Drop fwnode reference on ignored node
PATCH 1/1 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 Andy Shevchenko <[email protected]>
Signed-off-by Sakari Ailus <[email protected]>
--- drivers/leds/leds-as3645a.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/leds/leds-as3645a.c +2 -1
@@ -493,16 +493,17 @@ static int as3645a_parse_node(struct as3645a *flash,switch (id) {case AS_LED_FLASH : flash->flash_node = child; +fwnode_handle_get (child);break ;case AS_LED_INDICATOR : flash->indicator_node = child; +fwnode_handle_get (child);break ;default :dev_warn (&flash->client->dev,"unknown LED %u encountered, ignoring\n" , id);break ; } -fwnode_handle_get (child); }if (!flash->flash_node) {
Signature · 1 line
2.20.1
Quoted 3 lines · Sakari Ailus
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.
FWIW,
Reviewed-by Andy Shevchenko <[email protected]>
Quoted 32 lines
Reported-by Andy Shevchenko <[email protected]>Signed-off-by Sakari Ailus <[email protected]>--- drivers/leds/leds-as3645a.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/leds/leds-as3645a.c +2
-1@@ -493,16 +493,17 @@ static int as3645a_parse_node(struct as3645a *flash,switch (id) {case AS_LED_FLASH : flash->flash_node = child; +fwnode_handle_get (child);break ;case AS_LED_INDICATOR : flash->indicator_node = child; +fwnode_handle_get (child);break ;default :dev_warn (&flash->client->dev,"unknown LED %u encountered, ignoring\n" , id);break ; } -fwnode_handle_get (child); }if (!flash->flash_node) {Signature · 1 line
2.20.1
Signature · 2 lines
With Best Regards, Andy Shevchenko
Pavel Machek
AppliedQuoted 5 lines · Sakari Ailus
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 Andy Shevchenko <[email protected]>Signed-off-by Sakari Ailus <[email protected]>
Thanks, applied.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html