* [PATCH -next] mtd: ofpart: use for_each_child_of_node() macro
@ 2013-08-23 3:04 ` Wei Yongjun
0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2013-08-23 3:04 UTC (permalink / raw)
To: dwmw2, grant.likely, rob.herring; +Cc: yongjun_wei, linux-mtd, devicetree
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Use for_each_child_of_node() macro instead of open coding it.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
drivers/mtd/ofpart.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 7843a44..d64f8c3 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -43,9 +43,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
return 0;
/* First count the subnodes */
- pp = NULL;
nr_parts = 0;
- while ((pp = of_get_next_child(node, pp))) {
+ for_each_child_of_node(node, pp) {
if (node_has_compatible(pp))
continue;
@@ -59,9 +58,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
if (!*pparts)
return -ENOMEM;
- pp = NULL;
i = 0;
- while ((pp = of_get_next_child(node, pp))) {
+ for_each_child_of_node(node, pp) {
const __be32 *reg;
int len;
int a_cells, s_cells;
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH -next] mtd: ofpart: use for_each_child_of_node() macro
@ 2013-08-23 3:04 ` Wei Yongjun
0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2013-08-23 3:04 UTC (permalink / raw)
To: dwmw2, grant.likely, rob.herring; +Cc: devicetree, yongjun_wei, linux-mtd
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Use for_each_child_of_node() macro instead of open coding it.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
drivers/mtd/ofpart.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 7843a44..d64f8c3 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -43,9 +43,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
return 0;
/* First count the subnodes */
- pp = NULL;
nr_parts = 0;
- while ((pp = of_get_next_child(node, pp))) {
+ for_each_child_of_node(node, pp) {
if (node_has_compatible(pp))
continue;
@@ -59,9 +58,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
if (!*pparts)
return -ENOMEM;
- pp = NULL;
i = 0;
- while ((pp = of_get_next_child(node, pp))) {
+ for_each_child_of_node(node, pp) {
const __be32 *reg;
int len;
int a_cells, s_cells;
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mtd: ofpart: use for_each_child_of_node() macro
2013-08-23 3:04 ` Wei Yongjun
@ 2013-08-23 7:42 ` Huang Shijie
-1 siblings, 0 replies; 6+ messages in thread
From: Huang Shijie @ 2013-08-23 7:42 UTC (permalink / raw)
To: Wei Yongjun
Cc: dwmw2, grant.likely, rob.herring, devicetree, yongjun_wei, linux-mtd
于 2013年08月23日 11:04, Wei Yongjun 写道:
> From: Wei Yongjun<yongjun_wei@trendmicro.com.cn>
>
> Use for_each_child_of_node() macro instead of open coding it.
>
> Signed-off-by: Wei Yongjun<yongjun_wei@trendmicro.com.cn>
> ---
> drivers/mtd/ofpart.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
> index 7843a44..d64f8c3 100644
> --- a/drivers/mtd/ofpart.c
> +++ b/drivers/mtd/ofpart.c
> @@ -43,9 +43,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
> return 0;
>
> /* First count the subnodes */
> - pp = NULL;
> nr_parts = 0;
> - while ((pp = of_get_next_child(node, pp))) {
> + for_each_child_of_node(node, pp) {
> if (node_has_compatible(pp))
> continue;
>
> @@ -59,9 +58,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
> if (!*pparts)
> return -ENOMEM;
>
> - pp = NULL;
> i = 0;
> - while ((pp = of_get_next_child(node, pp))) {
> + for_each_child_of_node(node, pp) {
> const __be32 *reg;
> int len;
> int a_cells, s_cells;
Acked-by: Huang Shijie <b32955@freescale.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mtd: ofpart: use for_each_child_of_node() macro
@ 2013-08-23 7:42 ` Huang Shijie
0 siblings, 0 replies; 6+ messages in thread
From: Huang Shijie @ 2013-08-23 7:42 UTC (permalink / raw)
To: Wei Yongjun
Cc: devicetree, rob.herring, yongjun_wei, linux-mtd, grant.likely, dwmw2
于 2013年08月23日 11:04, Wei Yongjun 写道:
> From: Wei Yongjun<yongjun_wei@trendmicro.com.cn>
>
> Use for_each_child_of_node() macro instead of open coding it.
>
> Signed-off-by: Wei Yongjun<yongjun_wei@trendmicro.com.cn>
> ---
> drivers/mtd/ofpart.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
> index 7843a44..d64f8c3 100644
> --- a/drivers/mtd/ofpart.c
> +++ b/drivers/mtd/ofpart.c
> @@ -43,9 +43,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
> return 0;
>
> /* First count the subnodes */
> - pp = NULL;
> nr_parts = 0;
> - while ((pp = of_get_next_child(node, pp))) {
> + for_each_child_of_node(node, pp) {
> if (node_has_compatible(pp))
> continue;
>
> @@ -59,9 +58,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
> if (!*pparts)
> return -ENOMEM;
>
> - pp = NULL;
> i = 0;
> - while ((pp = of_get_next_child(node, pp))) {
> + for_each_child_of_node(node, pp) {
> const __be32 *reg;
> int len;
> int a_cells, s_cells;
Acked-by: Huang Shijie <b32955@freescale.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mtd: ofpart: use for_each_child_of_node() macro
2013-08-23 3:04 ` Wei Yongjun
@ 2013-08-24 5:10 ` Brian Norris
-1 siblings, 0 replies; 6+ messages in thread
From: Brian Norris @ 2013-08-24 5:10 UTC (permalink / raw)
To: Wei Yongjun
Cc: dwmw2, grant.likely, rob.herring, devicetree, yongjun_wei,
linux-mtd, Huang Shijie
On Fri, Aug 23, 2013 at 11:04:27AM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Use for_each_child_of_node() macro instead of open coding it.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Pushed to l2-mtd.git. Thanks!
Brian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mtd: ofpart: use for_each_child_of_node() macro
@ 2013-08-24 5:10 ` Brian Norris
0 siblings, 0 replies; 6+ messages in thread
From: Brian Norris @ 2013-08-24 5:10 UTC (permalink / raw)
To: Wei Yongjun
Cc: devicetree, rob.herring, Huang Shijie, yongjun_wei, linux-mtd,
grant.likely, dwmw2
On Fri, Aug 23, 2013 at 11:04:27AM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Use for_each_child_of_node() macro instead of open coding it.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Pushed to l2-mtd.git. Thanks!
Brian
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-08-24 5:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-23 3:04 [PATCH -next] mtd: ofpart: use for_each_child_of_node() macro Wei Yongjun
2013-08-23 3:04 ` Wei Yongjun
2013-08-23 7:42 ` Huang Shijie
2013-08-23 7:42 ` Huang Shijie
2013-08-24 5:10 ` Brian Norris
2013-08-24 5:10 ` Brian Norris
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.