From: Grant Likely <grant.likely@secretlab.ca>
To: Andreas Larsson <andreas@gaisler.com>
Cc: devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
Rob Herring <rob.herring@calxeda.com>
Subject: Re: [PATCH] of: Create function for counting number of phandles in a property
Date: Tue, 12 Feb 2013 17:28:07 +0000 [thread overview]
Message-ID: <20130212172807.AAF993E0B53@localhost> (raw)
In-Reply-To: <511A08D2.6010104@gaisler.com>
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.
prev parent reply other threads:[~2013-02-12 17:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-10 23:58 [PATCH] of: Create function for counting number of phandles in a property Grant Likely
2013-02-11 11:26 ` Andreas Larsson
2013-02-12 17:25 ` Grant Likely
2013-02-12 9:18 ` Andreas Larsson
2013-02-12 17:28 ` Grant Likely [this message]
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=20130212172807.AAF993E0B53@localhost \
--to=grant.likely@secretlab.ca \
--cc=andreas@gaisler.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.herring@calxeda.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.