Skip to content

Commit 60ea89e

Browse files
Wei YongjunDavid Woodhouse
authored andcommitted
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>
1 parent 3156231 commit 60ea89e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/mtd/ofpart.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
4343
return 0;
4444

4545
/* First count the subnodes */
46-
pp = NULL;
4746
nr_parts = 0;
48-
while ((pp = of_get_next_child(node, pp))) {
47+
for_each_child_of_node(node, pp) {
4948
if (node_has_compatible(pp))
5049
continue;
5150

@@ -59,9 +58,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
5958
if (!*pparts)
6059
return -ENOMEM;
6160

62-
pp = NULL;
6361
i = 0;
64-
while ((pp = of_get_next_child(node, pp))) {
62+
for_each_child_of_node(node, pp) {
6563
const __be32 *reg;
6664
int len;
6765
int a_cells, s_cells;

0 commit comments

Comments
 (0)