From: jamie@jamieiles.com (Jamie Iles)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 11/13] of: add property iteration helpers
Date: Fri, 26 Aug 2011 17:16:33 +0100 [thread overview]
Message-ID: <20110826161633.GB2802@pulham.picochip.com> (raw)
In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF04B24A40C8@HQMAIL01.nvidia.com>
On Fri, Aug 26, 2011 at 08:59:44AM -0700, Stephen Warren wrote:
> Jamie Iles wrote at Friday, August 26, 2011 3:27 AM:
> > For the !CONFIG_OF case, I *think* that
> > of_iter_u32_prop and of_iter_string_prop can be empty struct's, but I
> > wouldn't want to bet money on that!
>
> Empty structs themselves certainly did compile OK, but the code that
> uses these macros references iter.value directly, and isn't under #ifdef
> CONFIG_OF, so that field has to exist.
>
> I suppose an alternative would be to add an accessor function:
>
> struct of_iter_string_prop iter;
> for_each_string_property_value(iter, np, "pins")
> printk("Got value %s\n", of_iter_string_value(iter));
>
> which would return NULL/"" when !CONFIG_OF, and hence allow iter.value
> to be removed too. Do you think that's a good approach? It'd be easy to
> implement.
I think I prefer what you have now rather than a separate accessor, but
I'm happy either way!
Jamie
next prev parent reply other threads:[~2011-08-26 16:16 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-25 23:43 [PATCH v3 00/13] arm/tegra: Initialize GPIO & pinmux from DT Stephen Warren
2011-08-25 23:43 ` [PATCH v3 01/13] arm/tegra: Prep boards for gpio/pinmux conversion to pdevs Stephen Warren
2011-08-25 23:43 ` [PATCH v3 02/13] docs/dt: Document nvidia, tegra20-gpio's nvidia, enabled-gpios property Stephen Warren
2011-08-25 23:43 ` [PATCH v3 03/13] arm/dt: Tegra: Add nvidia, enabled-gpios property to GPIO controller Stephen Warren
2011-08-25 23:43 ` [PATCH v3 04/13] docs/dt: Document nvidia,tegra20-pinmux binding Stephen Warren
2011-08-25 23:43 ` [PATCH v3 05/13] arm/dt: Tegra: Add pinmux node Stephen Warren
2011-08-25 23:43 ` [PATCH v3 06/13] dt: add empty for_each_child_of_node, of_find_property Stephen Warren
2011-08-31 18:25 ` Stephen Warren
2011-08-25 23:43 ` [PATCH v3 07/13] gpio/tegra: Convert to a platform device Stephen Warren
2011-08-25 23:43 ` [PATCH v3 08/13] gpio/tegra: Add device tree support Stephen Warren
2011-08-25 23:43 ` [PATCH v3 09/13] arm/tegra: Convert pinmux driver to a platform device Stephen Warren
2011-08-25 23:43 ` [PATCH v3 10/13] of: add a generic pinmux helper Stephen Warren
2011-08-26 9:16 ` Jamie Iles
2011-08-29 11:09 ` Linus Walleij
2011-08-29 21:46 ` Stephen Warren
2011-09-01 11:30 ` Linus Walleij
2011-08-25 23:43 ` [PATCH v3 11/13] of: add property iteration helpers Stephen Warren
2011-08-26 9:26 ` Jamie Iles
2011-08-26 15:59 ` Stephen Warren
2011-08-26 16:16 ` Jamie Iles [this message]
2011-08-25 23:43 ` [PATCH v3 12/13] arm/tegra: Add device tree support to pinmux driver Stephen Warren
2011-08-25 23:43 ` [PATCH v3 13/13] arm/tegra: board-dt: Remove dependency on non-dt pinmux functions Stephen Warren
2011-08-26 5:04 ` [PATCH v3 00/13] arm/tegra: Initialize GPIO & pinmux from DT Olof Johansson
2011-08-26 16:07 ` Stephen Warren
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=20110826161633.GB2802@pulham.picochip.com \
--to=jamie@jamieiles.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).