Skip to content

Commit

Permalink
mtd: ofpart: use for_each_child_of_node() macro
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and David Woodhouse committed Aug 30, 2013
1 parent 3156231 commit 60ea89e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/mtd/ofpart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit 60ea89e

Please sign in to comment.