aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sunhme.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sunhme.c')
-rw-r--r--drivers/net/sunhme.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index cc4013be5e18..d4fb4acdbebd 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -2543,25 +2543,36 @@ static struct quattro * __devinit quattro_sbus_find(struct of_device *child)
2543} 2543}
2544 2544
2545/* After all quattro cards have been probed, we call these functions 2545/* After all quattro cards have been probed, we call these functions
2546 * to register the IRQ handlers. 2546 * to register the IRQ handlers for the cards that have been
2547 * successfully probed and skip the cards that failed to initialize
2547 */ 2548 */
2548static void __init quattro_sbus_register_irqs(void) 2549static int __init quattro_sbus_register_irqs(void)
2549{ 2550{
2550 struct quattro *qp; 2551 struct quattro *qp;
2551 2552
2552 for (qp = qfe_sbus_list; qp != NULL; qp = qp->next) { 2553 for (qp = qfe_sbus_list; qp != NULL; qp = qp->next) {
2553 struct of_device *op = qp->quattro_dev; 2554 struct of_device *op = qp->quattro_dev;
2554 int err; 2555 int err, qfe_slot, skip = 0;
2556
2557 for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) {
2558 if (!qp->happy_meals[qfe_slot])
2559 skip = 1;
2560 }
2561 if (skip)
2562 continue;
2555 2563
2556 err = request_irq(op->irqs[0], 2564 err = request_irq(op->irqs[0],
2557 quattro_sbus_interrupt, 2565 quattro_sbus_interrupt,
2558 IRQF_SHARED, "Quattro", 2566 IRQF_SHARED, "Quattro",
2559 qp); 2567 qp);
2560 if (err != 0) { 2568 if (err != 0) {
2561 printk(KERN_ERR "Quattro: Fatal IRQ registery error %d.\n", err); 2569 printk(KERN_ERR "Quattro HME: IRQ registration "
2562 panic("QFE request irq"); 2570 "error %d.\n", err);
2571 return err;
2563 } 2572 }
2564 } 2573 }
2574
2575 return 0;
2565} 2576}
2566 2577
2567static void quattro_sbus_free_irqs(void) 2578static void quattro_sbus_free_irqs(void)
@@ -2570,6 +2581,14 @@ static void quattro_sbus_free_irqs(void)
2570 2581
2571 for (qp = qfe_sbus_list; qp != NULL; qp = qp->next) { 2582 for (qp = qfe_sbus_list; qp != NULL; qp = qp->next) {
2572 struct of_device *op = qp->quattro_dev; 2583 struct of_device *op = qp->quattro_dev;
2584 int qfe_slot, skip = 0;
2585
2586 for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) {
2587 if (!qp->happy_meals[qfe_slot])
2588 skip = 1;
2589 }
2590 if (skip)
2591 continue;
2573 2592
2574 free_irq(op->irqs[0], qp); 2593 free_irq(op->irqs[0], qp);
2575 } 2594 }
@@ -2828,6 +2847,9 @@ err_out_iounmap:
2828 if (hp->tcvregs) 2847 if (hp->tcvregs)
2829 of_iounmap(&op->resource[4], hp->tcvregs, TCVR_REG_SIZE); 2848 of_iounmap(&op->resource[4], hp->tcvregs, TCVR_REG_SIZE);
2830 2849
2850 if (qp)
2851 qp->happy_meals[qfe_slot] = NULL;
2852
2831err_out_free_netdev: 2853err_out_free_netdev:
2832 free_netdev(dev); 2854 free_netdev(dev);
2833 2855
@@ -3285,7 +3307,7 @@ static int __init happy_meal_sbus_init(void)
3285 3307
3286 err = of_register_driver(&hme_sbus_driver, &of_bus_type); 3308 err = of_register_driver(&hme_sbus_driver, &of_bus_type);
3287 if (!err) 3309 if (!err)
3288 quattro_sbus_register_irqs(); 3310 err = quattro_sbus_register_irqs();
3289 3311
3290 return err; 3312 return err;
3291} 3313}