aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-08-22 23:04:27 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2013-08-30 16:52:57 -0400
commit60ea89e22aa5de529d0fdb9de07504afa8e5d4b0 (patch)
tree7e095f54ce794734249608d49011782d02e684df /drivers/mtd
parent3156231fb644cf29c1d7f21766ff9e33dc9761d3 (diff)
mtd: ofpart: use for_each_child_of_node() macro
Use for_each_child_of_node() macro instead of open coding it. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Huang Shijie <b32955@freescale.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ofpart.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 7843a4491217..d64f8c30945f 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -43,9 +43,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
43 return 0; 43 return 0;
44 44
45 /* First count the subnodes */ 45 /* First count the subnodes */
46 pp = NULL;
47 nr_parts = 0; 46 nr_parts = 0;
48 while ((pp = of_get_next_child(node, pp))) { 47 for_each_child_of_node(node, pp) {
49 if (node_has_compatible(pp)) 48 if (node_has_compatible(pp))
50 continue; 49 continue;
51 50
@@ -59,9 +58,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
59 if (!*pparts) 58 if (!*pparts)
60 return -ENOMEM; 59 return -ENOMEM;
61 60
62 pp = NULL;
63 i = 0; 61 i = 0;
64 while ((pp = of_get_next_child(node, pp))) { 62 for_each_child_of_node(node, pp) {
65 const __be32 *reg; 63 const __be32 *reg;
66 int len; 64 int len;
67 int a_cells, s_cells; 65 int a_cells, s_cells;