提交 60ea89e2 编写于 作者: W Wei Yongjun 提交者: David Woodhouse

mtd: ofpart: use for_each_child_of_node() macro

Use for_each_child_of_node() macro instead of open coding it.
Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: NHuang Shijie <b32955@freescale.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 3156231f
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册