linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>, Dan Murphy <dmurphy@ti.com>,
	linux-leds@vger.kernel.org
Subject: Re: [PATCH v2 2/2] leds: Switch to use fwnode instead of be stuck with OF one
Date: Fri, 23 Aug 2019 23:36:34 +0300	[thread overview]
Message-ID: <20190823203634.GX30120@smile.fi.intel.com> (raw)
In-Reply-To: <08858604-8a89-870f-9234-21c7fdd1d165@gmail.com>

On Fri, Aug 23, 2019 at 08:14:49PM +0200, Jacek Anaszewski wrote:
> On 8/22/19 5:19 PM, Andy Shevchenko wrote:

> > -	if (!np)
> > -		return NULL;
> 
> Why aren't you checking fwnode for being not NULL?
> It is not guaranteed to be always initialized.

And this is handled by the below. Even in the original code the check was
redundant. Note, led_parse_fwnode_props() is written with the same redundancy.

> > -	count = of_property_count_u32_elems(np, "led-pattern");
> > +	count = fwnode_property_count_u32(fwnode, "led-pattern");
> >  	if (count < 0)
> >  		return NULL;

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2019-08-23 20:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 15:19 [PATCH v2 1/2] leds: max77650: Switch to fwnode property API Andy Shevchenko
2019-08-22 15:19 ` [PATCH v2 2/2] leds: Switch to use fwnode instead of be stuck with OF one Andy Shevchenko
2019-08-23 18:14   ` Jacek Anaszewski
2019-08-23 20:36     ` Andy Shevchenko [this message]
2019-08-24 14:08       ` Jacek Anaszewski

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=20190823203634.GX30120@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=dmurphy@ti.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).