aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/mv64x60_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/sysdev/mv64x60_dev.c')
-rw-r--r--arch/powerpc/sysdev/mv64x60_dev.c52
1 files changed, 30 insertions, 22 deletions
diff --git a/arch/powerpc/sysdev/mv64x60_dev.c b/arch/powerpc/sysdev/mv64x60_dev.c
index 047b31027fa6..41af1223e2a0 100644
--- a/arch/powerpc/sysdev/mv64x60_dev.c
+++ b/arch/powerpc/sysdev/mv64x60_dev.c
@@ -338,15 +338,13 @@ static int __init mv64x60_i2c_device_setup(struct device_node *np, int id)
338 338
339 pdata.freq_m = 8; /* default */ 339 pdata.freq_m = 8; /* default */
340 prop = of_get_property(np, "freq_m", NULL); 340 prop = of_get_property(np, "freq_m", NULL);
341 if (!prop) 341 if (prop)
342 return -ENODEV; 342 pdata.freq_m = *prop;
343 pdata.freq_m = *prop;
344 343
345 pdata.freq_m = 3; /* default */ 344 pdata.freq_m = 3; /* default */
346 prop = of_get_property(np, "freq_n", NULL); 345 prop = of_get_property(np, "freq_n", NULL);
347 if (!prop) 346 if (prop)
348 return -ENODEV; 347 pdata.freq_n = *prop;
349 pdata.freq_n = *prop;
350 348
351 pdata.timeout = 1000; /* default: 1 second */ 349 pdata.timeout = 1000; /* default: 1 second */
352 350
@@ -433,9 +431,13 @@ static int __init mv64x60_device_setup(void)
433 int err; 431 int err;
434 432
435 id = 0; 433 id = 0;
436 for_each_compatible_node(np, "serial", "marvell,mv64360-mpsc") 434 for_each_compatible_node(np, "serial", "marvell,mv64360-mpsc") {
437 if ((err = mv64x60_mpsc_device_setup(np, id++))) 435 err = mv64x60_mpsc_device_setup(np, id++);
438 goto error; 436 if (err)
437 printk(KERN_ERR "Failed to initialize MV64x60 "
438 "serial device %s: error %d.\n",
439 np->full_name, err);
440 }
439 441
440 id = 0; 442 id = 0;
441 id2 = 0; 443 id2 = 0;
@@ -443,38 +445,44 @@ static int __init mv64x60_device_setup(void)
443 pdev = mv64x60_eth_register_shared_pdev(np, id++); 445 pdev = mv64x60_eth_register_shared_pdev(np, id++);
444 if (IS_ERR(pdev)) { 446 if (IS_ERR(pdev)) {
445 err = PTR_ERR(pdev); 447 err = PTR_ERR(pdev);
446 goto error; 448 printk(KERN_ERR "Failed to initialize MV64x60 "
449 "network block %s: error %d.\n",
450 np->full_name, err);
451 continue;
447 } 452 }
448 for_each_child_of_node(np, np2) { 453 for_each_child_of_node(np, np2) {
449 if (!of_device_is_compatible(np2, 454 if (!of_device_is_compatible(np2,
450 "marvell,mv64360-eth")) 455 "marvell,mv64360-eth"))
451 continue; 456 continue;
452 err = mv64x60_eth_device_setup(np2, id2++, pdev); 457 err = mv64x60_eth_device_setup(np2, id2++, pdev);
453 if (err) { 458 if (err)
454 of_node_put(np2); 459 printk(KERN_ERR "Failed to initialize "
455 goto error; 460 "MV64x60 network device %s: "
456 } 461 "error %d.\n",
462 np2->full_name, err);
457 } 463 }
458 } 464 }
459 465
460 id = 0; 466 id = 0;
461 for_each_compatible_node(np, "i2c", "marvell,mv64360-i2c") 467 for_each_compatible_node(np, "i2c", "marvell,mv64360-i2c") {
462 if ((err = mv64x60_i2c_device_setup(np, id++))) 468 err = mv64x60_i2c_device_setup(np, id++);
463 goto error; 469 if (err)
470 printk(KERN_ERR "Failed to initialize MV64x60 I2C "
471 "bus %s: error %d.\n",
472 np->full_name, err);
473 }
464 474
465 /* support up to one watchdog timer */ 475 /* support up to one watchdog timer */
466 np = of_find_compatible_node(np, NULL, "marvell,mv64360-wdt"); 476 np = of_find_compatible_node(np, NULL, "marvell,mv64360-wdt");
467 if (np) { 477 if (np) {
468 if ((err = mv64x60_wdt_device_setup(np, id))) 478 if ((err = mv64x60_wdt_device_setup(np, id)))
469 goto error; 479 printk(KERN_ERR "Failed to initialize MV64x60 "
480 "Watchdog %s: error %d.\n",
481 np->full_name, err);
470 of_node_put(np); 482 of_node_put(np);
471 } 483 }
472 484
473 return 0; 485 return 0;
474
475error:
476 of_node_put(np);
477 return err;
478} 486}
479arch_initcall(mv64x60_device_setup); 487arch_initcall(mv64x60_device_setup);
480 488