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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux