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/mv64x60_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/mv64x60_dev.c')
-rw-r--r-- | arch/powerpc/sysdev/mv64x60_dev.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/arch/powerpc/sysdev/mv64x60_dev.c b/arch/powerpc/sysdev/mv64x60_dev.c index 548a32082e4a..304056cafb1e 100644 --- a/arch/powerpc/sysdev/mv64x60_dev.c +++ b/arch/powerpc/sysdev/mv64x60_dev.c | |||
@@ -241,7 +241,7 @@ static int __init mv64x60_eth_device_setup(struct device_node *np, int id) | |||
241 | 241 | ||
242 | /* only register the shared platform device the first time through */ | 242 | /* only register the shared platform device the first time through */ |
243 | if (id == 0 && (err = eth_register_shared_pdev(np))) | 243 | if (id == 0 && (err = eth_register_shared_pdev(np))) |
244 | return err;; | 244 | return err; |
245 | 245 | ||
246 | memset(r, 0, sizeof(r)); | 246 | memset(r, 0, sizeof(r)); |
247 | of_irq_to_resource(np, 0, &r[0]); | 247 | of_irq_to_resource(np, 0, &r[0]); |
@@ -451,22 +451,19 @@ static int __init mv64x60_device_setup(void) | |||
451 | int id; | 451 | int id; |
452 | int err; | 452 | int err; |
453 | 453 | ||
454 | for (id = 0; | 454 | id = 0; |
455 | (np = of_find_compatible_node(np, "serial", "marvell,mpsc")); id++) | 455 | for_each_compatible_node(np, "serial", "marvell,mpsc") |
456 | if ((err = mv64x60_mpsc_device_setup(np, id))) | 456 | if ((err = mv64x60_mpsc_device_setup(np, id++))) |
457 | goto error; | 457 | goto error; |
458 | 458 | ||
459 | for (id = 0; | 459 | id = 0; |
460 | (np = of_find_compatible_node(np, "network", | 460 | for_each_compatible_node(np, "network", "marvell,mv64x60-eth") |
461 | "marvell,mv64x60-eth")); | 461 | if ((err = mv64x60_eth_device_setup(np, id++))) |
462 | id++) | ||
463 | if ((err = mv64x60_eth_device_setup(np, id))) | ||
464 | goto error; | 462 | goto error; |
465 | 463 | ||
466 | for (id = 0; | 464 | id = 0; |
467 | (np = of_find_compatible_node(np, "i2c", "marvell,mv64x60-i2c")); | 465 | for_each_compatible_node(np, "i2c", "marvell,mv64x60-i2c") |
468 | id++) | 466 | if ((err = mv64x60_i2c_device_setup(np, id++))) |
469 | if ((err = mv64x60_i2c_device_setup(np, id))) | ||
470 | goto error; | 467 | goto error; |
471 | 468 | ||
472 | /* support up to one watchdog timer */ | 469 | /* support up to one watchdog timer */ |
@@ -477,7 +474,6 @@ static int __init mv64x60_device_setup(void) | |||
477 | of_node_put(np); | 474 | of_node_put(np); |
478 | } | 475 | } |
479 | 476 | ||
480 | |||
481 | return 0; | 477 | return 0; |
482 | 478 | ||
483 | error: | 479 | error: |