Re: [PATCH -next] mtd: ofpart: use for_each_child_of_node() macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




于 2013年08月23日 11:04, Wei Yongjun 写道:
From: Wei Yongjun<yongjun_wei@xxxxxxxxxxxxxxxxx>

Use for_each_child_of_node() macro instead of open coding it.

Signed-off-by: Wei Yongjun<yongjun_wei@xxxxxxxxxxxxxxxxx>
---
  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@xxxxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux