diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2007-11-29 14:44:36 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-16 22:56:54 -0500 |
commit | 26cb7d8bbddc8338904b8810b860ccf052c761fa (patch) | |
tree | 24a183faa00bcee80453ca1fa65f414ddea8d141 /arch/powerpc/sysdev/tsi108_dev.c | |
parent | 283029d16a882539ab0027afd94ac52858d050b2 (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.c | 9 |
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); | |||
66 | static int __init tsi108_eth_of_init(void) | 66 | static int __init tsi108_eth_of_init(void) |
67 | { | 67 | { |
68 | struct device_node *np; | 68 | struct device_node *np; |
69 | unsigned int i; | 69 | unsigned int i = 0; |
70 | struct platform_device *tsi_eth_dev; | 70 | struct platform_device *tsi_eth_dev; |
71 | struct resource res; | 71 | struct resource res; |
72 | int ret; | 72 | int ret; |
73 | 73 | ||
74 | for (np = NULL, i = 0; | 74 | for_each_compatible_node(np, "network", "tsi108-ethernet") { |
75 | (np = of_find_compatible_node(np, "network", "tsi108-ethernet")) != NULL; | ||
76 | i++) { | ||
77 | struct resource r[2]; | 75 | struct resource r[2]; |
78 | struct device_node *phy, *mdio; | 76 | struct device_node *phy, *mdio; |
79 | hw_info tsi_eth_data; | 77 | hw_info tsi_eth_data; |
@@ -98,7 +96,7 @@ static int __init tsi108_eth_of_init(void) | |||
98 | __FUNCTION__,r[1].name, r[1].start, r[1].end); | 96 | __FUNCTION__,r[1].name, r[1].start, r[1].end); |
99 | 97 | ||
100 | tsi_eth_dev = | 98 | tsi_eth_dev = |
101 | platform_device_register_simple("tsi-ethernet", i, &r[0], | 99 | platform_device_register_simple("tsi-ethernet", i++, &r[0], |
102 | 1); | 100 | 1); |
103 | 101 | ||
104 | if (IS_ERR(tsi_eth_dev)) { | 102 | if (IS_ERR(tsi_eth_dev)) { |
@@ -154,6 +152,7 @@ static int __init tsi108_eth_of_init(void) | |||
154 | unreg: | 152 | unreg: |
155 | platform_device_unregister(tsi_eth_dev); | 153 | platform_device_unregister(tsi_eth_dev); |
156 | err: | 154 | err: |
155 | of_node_put(np); | ||
157 | return ret; | 156 | return ret; |
158 | } | 157 | } |
159 | 158 | ||