summaryrefslogtreecommitdiff
path: root/arch/powerpc/sysdev/tsi108_dev.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2007-11-30 06:44:36 +1100
committerPaul Mackerras <paulus@samba.org>2008-01-17 14:56:54 +1100
commit26cb7d8bbddc8338904b8810b860ccf052c761fa (patch)
tree24a183faa00bcee80453ca1fa65f414ddea8d141 /arch/powerpc/sysdev/tsi108_dev.c
parent283029d16a882539ab0027afd94ac52858d050b2 (diff)
[POWERPC] Use for_each macros in arch/powerpc/sysdev
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/sysdev/tsi108_dev.c')
-rw-r--r--arch/powerpc/sysdev/tsi108_dev.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/powerpc/sysdev/tsi108_dev.c b/arch/powerpc/sysdev/tsi108_dev.c
index a113d800cbf0..be2808a292f7 100644
--- a/arch/powerpc/sysdev/tsi108_dev.c
+++ b/arch/powerpc/sysdev/tsi108_dev.c
@@ -66,14 +66,12 @@ EXPORT_SYMBOL(get_vir_csrbase);
static int __init tsi108_eth_of_init(void)
{
struct device_node *np;
- unsigned int i;
+ unsigned int i = 0;
struct platform_device *tsi_eth_dev;
struct resource res;
int ret;
- for (np = NULL, i = 0;
- (np = of_find_compatible_node(np, "network", "tsi108-ethernet")) != NULL;
- i++) {
+ for_each_compatible_node(np, "network", "tsi108-ethernet") {
struct resource r[2];
struct device_node *phy, *mdio;
hw_info tsi_eth_data;
@@ -98,7 +96,7 @@ static int __init tsi108_eth_of_init(void)
__FUNCTION__,r[1].name, r[1].start, r[1].end);
tsi_eth_dev =
- platform_device_register_simple("tsi-ethernet", i, &r[0],
+ platform_device_register_simple("tsi-ethernet", i++, &r[0],
1);
if (IS_ERR(tsi_eth_dev)) {
@@ -154,6 +152,7 @@ static int __init tsi108_eth_of_init(void)
unreg:
platform_device_unregister(tsi_eth_dev);
err:
+ of_node_put(np);
return ret;
}