lkml.org 
[lkml]   [2013]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] of: Create function for counting number of phandles in a property
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.

Cheers,
Andreas Larsson



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