All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-leds@vger.kernel.org
Subject: Re: [PATCH 1/1] leds-as3645a: Drop fwnode reference on ignored node
Date: Mon, 9 Dec 2019 14:34:26 +0200	[thread overview]
Message-ID: <20191209123426.GF32742@smile.fi.intel.com> (raw)
In-Reply-To: <20191204075642.22070-1-sakari.ailus@linux.intel.com>

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



  reply	other threads:[~2019-12-09 12:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2019-12-21 19:02 ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191209123426.GF32742@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.