From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1] dt: reform for_each_property to for_each_property_of_node_of_node
Date: Tue, 20 Dec 2011 12:49:52 -0600 [thread overview]
Message-ID: <4EF0D8D0.1020505@gmail.com> (raw)
In-Reply-To: <1324403518-3462-1-git-send-email-b29396@freescale.com>
On 12/20/2011 11:51 AM, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@linaro.org>
>
> Make this micro more easy to use(do not need to pass properties, a node is
Make this macro easier to use...
> enough), also change to a more sensible name as for_each_child_of_node.
>
> Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Shawn Guo <shawn.guo@freescale.com>
> ---
> drivers/of/base.c | 2 +-
> include/linux/of.h | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 9b6588e..f6f6fe8 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1159,7 +1159,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
> if (!of_aliases)
> return;
>
> - for_each_property(pp, of_aliases->properties) {
> + for_each_property_of_node(of_aliases, pp) {
> const char *start = pp->name;
> const char *end = start + strlen(start);
> struct device_node *np;
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 4948552..f1a490c 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -219,8 +219,8 @@ extern int of_device_is_available(const struct device_node *device);
> extern const void *of_get_property(const struct device_node *node,
> const char *name,
> int *lenp);
> -#define for_each_property(pp, properties) \
> - for (pp = properties; pp != NULL; pp = pp->next)
> +#define for_each_property_of_node(dn, pp) \
> + for (pp = dn->properties; pp != NULL; pp = pp->next)
Probably should prepend it with "of_" while you're at it.
Rob
WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robherring2@gmail.com>
To: Dong Aisheng <b29396@freescale.com>
Cc: grant.likely@secretlab.ca, devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, shawn.guo@freescale.com
Subject: Re: [PATCH 1/1] dt: reform for_each_property to for_each_property_of_node_of_node
Date: Tue, 20 Dec 2011 12:49:52 -0600 [thread overview]
Message-ID: <4EF0D8D0.1020505@gmail.com> (raw)
In-Reply-To: <1324403518-3462-1-git-send-email-b29396@freescale.com>
On 12/20/2011 11:51 AM, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@linaro.org>
>
> Make this micro more easy to use(do not need to pass properties, a node is
Make this macro easier to use...
> enough), also change to a more sensible name as for_each_child_of_node.
>
> Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Shawn Guo <shawn.guo@freescale.com>
> ---
> drivers/of/base.c | 2 +-
> include/linux/of.h | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 9b6588e..f6f6fe8 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1159,7 +1159,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
> if (!of_aliases)
> return;
>
> - for_each_property(pp, of_aliases->properties) {
> + for_each_property_of_node(of_aliases, pp) {
> const char *start = pp->name;
> const char *end = start + strlen(start);
> struct device_node *np;
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 4948552..f1a490c 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -219,8 +219,8 @@ extern int of_device_is_available(const struct device_node *device);
> extern const void *of_get_property(const struct device_node *node,
> const char *name,
> int *lenp);
> -#define for_each_property(pp, properties) \
> - for (pp = properties; pp != NULL; pp = pp->next)
> +#define for_each_property_of_node(dn, pp) \
> + for (pp = dn->properties; pp != NULL; pp = pp->next)
Probably should prepend it with "of_" while you're at it.
Rob
WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robherring2@gmail.com>
To: Dong Aisheng <b29396@freescale.com>
Cc: devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, grant.likely@secretlab.ca,
shawn.guo@freescale.com
Subject: Re: [PATCH 1/1] dt: reform for_each_property to for_each_property_of_node_of_node
Date: Tue, 20 Dec 2011 12:49:52 -0600 [thread overview]
Message-ID: <4EF0D8D0.1020505@gmail.com> (raw)
In-Reply-To: <1324403518-3462-1-git-send-email-b29396@freescale.com>
On 12/20/2011 11:51 AM, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@linaro.org>
>
> Make this micro more easy to use(do not need to pass properties, a node is
Make this macro easier to use...
> enough), also change to a more sensible name as for_each_child_of_node.
>
> Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Shawn Guo <shawn.guo@freescale.com>
> ---
> drivers/of/base.c | 2 +-
> include/linux/of.h | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 9b6588e..f6f6fe8 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1159,7 +1159,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
> if (!of_aliases)
> return;
>
> - for_each_property(pp, of_aliases->properties) {
> + for_each_property_of_node(of_aliases, pp) {
> const char *start = pp->name;
> const char *end = start + strlen(start);
> struct device_node *np;
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 4948552..f1a490c 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -219,8 +219,8 @@ extern int of_device_is_available(const struct device_node *device);
> extern const void *of_get_property(const struct device_node *node,
> const char *name,
> int *lenp);
> -#define for_each_property(pp, properties) \
> - for (pp = properties; pp != NULL; pp = pp->next)
> +#define for_each_property_of_node(dn, pp) \
> + for (pp = dn->properties; pp != NULL; pp = pp->next)
Probably should prepend it with "of_" while you're at it.
Rob
next prev parent reply other threads:[~2011-12-20 18:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-20 17:51 [PATCH 1/1] dt: reform for_each_property to for_each_property_of_node_of_node Dong Aisheng
2011-12-20 17:51 ` Dong Aisheng
2011-12-20 17:51 ` Dong Aisheng
2011-12-20 18:49 ` Rob Herring [this message]
2011-12-20 18:49 ` Rob Herring
2011-12-20 18:49 ` Rob Herring
2011-12-21 3:02 ` Dong Aisheng-B29396
2011-12-21 3:02 ` Dong Aisheng-B29396
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=4EF0D8D0.1020505@gmail.com \
--to=robherring2@gmail.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 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.