Linux-LEDs Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/1] leds-as3645a: Drop fwnode reference on ignored node
@ 2019-12-04  7:56 Sakari Ailus
  2019-12-09 12:34 ` Andy Shevchenko
  2019-12-21 19:02 ` Pavel Machek
  0 siblings, 2 replies; 3+ messages in thread
From: Sakari Ailus @ 2019-12-04  7:56 UTC (permalink / raw)
  To: linux-leds; +Cc: andriy.shevchenko

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 <andriy.shevchenko@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/leds/leds-as3645a.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
index b7e0ae1af8fa5..e8922fa033796 100644
--- a/drivers/leds/leds-as3645a.c
+++ b/drivers/leds/leds-as3645a.c
@@ -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) {
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] leds-as3645a: Drop fwnode reference on ignored node
  2019-12-04  7:56 [PATCH 1/1] leds-as3645a: Drop fwnode reference on ignored node Sakari Ailus
@ 2019-12-09 12:34 ` Andy Shevchenko
  2019-12-21 19:02 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2019-12-09 12:34 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-leds

On Wed, Dec 04, 2019 at 09:56:42AM +0200, Sakari Ailus wrote:
> 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 <andriy.shevchenko@linux.intel.com>

> Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  drivers/leds/leds-as3645a.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
> index b7e0ae1af8fa5..e8922fa033796 100644
> --- a/drivers/leds/leds-as3645a.c
> +++ b/drivers/leds/leds-as3645a.c
> @@ -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) {
> -- 
> 2.20.1
> 

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] leds-as3645a: Drop fwnode reference on ignored node
  2019-12-04  7:56 [PATCH 1/1] leds-as3645a: Drop fwnode reference on ignored node Sakari Ailus
  2019-12-09 12:34 ` Andy Shevchenko
@ 2019-12-21 19:02 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2019-12-21 19:02 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-leds, andriy.shevchenko

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

On Wed 2019-12-04 09:56:42, Sakari Ailus wrote:
> 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 <andriy.shevchenko@intel.com>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Thanks, applied.
								Pavel
								
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-04  7:56 [PATCH 1/1] leds-as3645a: Drop fwnode reference on ignored node Sakari Ailus
2019-12-09 12:34 ` Andy Shevchenko
2019-12-21 19:02 ` Pavel Machek

Linux-LEDs Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-leds/0 linux-leds/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-leds linux-leds/ https://lore.kernel.org/linux-leds \
		linux-leds@vger.kernel.org
	public-inbox-index linux-leds

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-leds


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git