powerpc/windfarm: Use for_each_node_by_type() macro
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Sun, 2 Dec 2012 03:00:09 +0000 (03:00 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 10 Jan 2013 06:00:36 +0000 (17:00 +1100)
Use for_each_node_by_type() macro instead of open coding it.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
drivers/macintosh/windfarm_pm112.c
drivers/macintosh/windfarm_pm72.c
drivers/macintosh/windfarm_rm31.c

index 35ef6e2582b85da123c9e0b9eb99889abc1b8b15..3024685e4cca553d16ad4cd893925343f0ca5ba1 100644 (file)
@@ -681,7 +681,7 @@ static int __init wf_pm112_init(void)
 
        /* Count the number of CPU cores */
        nr_cores = 0;
-       for (cpu = NULL; (cpu = of_find_node_by_type(cpu, "cpu")) != NULL; )
+       for_each_node_by_type(cpu, "cpu")
                ++nr_cores;
 
        printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n");
index 6e5585357cd356dfde400a0ab6590b94cdc22b03..2f506b9d5a52bbc3ffa9cdf543b722641115e80d 100644 (file)
@@ -804,7 +804,7 @@ static int __init wf_pm72_init(void)
 
        /* Count the number of CPU cores */
        nr_chips = 0;
-       for (cpu = NULL; (cpu = of_find_node_by_type(cpu, "cpu")) != NULL; )
+       for_each_node_by_type(cpu, "cpu")
                ++nr_chips;
        if (nr_chips > NR_CHIPS)
                nr_chips = NR_CHIPS;
index 844003fb4ef0d798001660e8ab8c58ad6d85354f..0b9a79b2f48aaded2397762ce500b032f25f77e1 100644 (file)
@@ -696,7 +696,7 @@ static int __init wf_rm31_init(void)
 
        /* Count the number of CPU cores */
        nr_chips = 0;
-       for (cpu = NULL; (cpu = of_find_node_by_type(cpu, "cpu")) != NULL; )
+       for_each_node_by_type(cpu, "cpu")
                ++nr_chips;
        if (nr_chips > NR_CHIPS)
                nr_chips = NR_CHIPS;