lkml.org 
[lkml]   [2013]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] of: Create function for counting number of phandles in a property
Date
On Tue, 12 Feb 2013 10:18:10 +0100, Andreas Larsson <andreas@gaisler.com> wrote:
> On 2013-02-11 00:58, Grant Likely wrote:
> > This patch creates of_count_phandle_with_args(), a new function for
> > counting the number of phandle+argument tuples in a given property. This
> > is better than the existing method of parsing each phandle individually
> > until parsing fails which is a horribly slow way to do the count.
> >
> > It also converts of_gpio_named_count() to use the new function instead
> > of using the above described horrible method.
> >
> > This also requires the return value of of_gpio_count() &
> > of_gpio_named_count() from 'unsigned int' to 'int' so that it can return
> > an error code. All the users of that function are fixed up to correctly
> > handle a negative return value.
>
> One more thing: In of_spi_register_master() in drivers/spi.c the error
> code is put in the unsigned variable nb, leading to a huge nb and
> master->num_chipselect with following problems when of_gpio_named_count
> returns an error code.

Also a good catch. Fixed.

g.



\
 
 \ /
  Last update: 2013-02-12 20:01    [W:3.183 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site