Re: [PATCH v2 2/2] leds: Switch to use fwnode instead of be stuck with OF one

Andy Shevchenko
2019-08-23T20:36:39Z

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