From c7c360eedb8c1eea302a224a8c83d19a4e4cf608 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Sun, 2 Dec 2012 03:00:09 +0000 Subject: powerpc/windfarm: Use for_each_node_by_type() macro Use for_each_node_by_type() macro instead of open coding it. Signed-off-by: Wei Yongjun Signed-off-by: Benjamin Herrenschmidt --- drivers/macintosh/windfarm_pm112.c | 2 +- drivers/macintosh/windfarm_pm72.c | 2 +- drivers/macintosh/windfarm_rm31.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c index 35ef6e2582b8..3024685e4cca 100644 --- a/drivers/macintosh/windfarm_pm112.c +++ b/drivers/macintosh/windfarm_pm112.c @@ -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"); diff --git a/drivers/macintosh/windfarm_pm72.c b/drivers/macintosh/windfarm_pm72.c index 6e5585357cd3..2f506b9d5a52 100644 --- a/drivers/macintosh/windfarm_pm72.c +++ b/drivers/macintosh/windfarm_pm72.c @@ -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; diff --git a/drivers/macintosh/windfarm_rm31.c b/drivers/macintosh/windfarm_rm31.c index 844003fb4ef0..0b9a79b2f48a 100644 --- a/drivers/macintosh/windfarm_rm31.c +++ b/drivers/macintosh/windfarm_rm31.c @@ -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; -- cgit v1.2.3-59-g8ed1b