diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index cc4013b..d4fb4ac 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -2543,25 +2543,36 @@
 }
 
 /* After all quattro cards have been probed, we call these functions
- * to register the IRQ handlers.
+ * to register the IRQ handlers for the cards that have been
+ * successfully probed and skip the cards that failed to initialize
  */
-static void __init quattro_sbus_register_irqs(void)
+static int __init quattro_sbus_register_irqs(void)
 {
 	struct quattro *qp;
 
 	for (qp = qfe_sbus_list; qp != NULL; qp = qp->next) {
 		struct of_device *op = qp->quattro_dev;
-		int err;
+		int err, qfe_slot, skip = 0;
+
+		for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) {
+			if (!qp->happy_meals[qfe_slot])
+				skip = 1;
+		}
+		if (skip)
+			continue;
 
 		err = request_irq(op->irqs[0],
 				  quattro_sbus_interrupt,
 				  IRQF_SHARED, "Quattro",
 				  qp);
 		if (err != 0) {
-			printk(KERN_ERR "Quattro: Fatal IRQ registery error %d.\n", err);
-			panic("QFE request irq");
+			printk(KERN_ERR "Quattro HME: IRQ registration "
+			       "error %d.\n", err);
+			return err;
 		}
 	}
+
+	return 0;
 }
 
 static void quattro_sbus_free_irqs(void)
@@ -2570,6 +2581,14 @@
 
 	for (qp = qfe_sbus_list; qp != NULL; qp = qp->next) {
 		struct of_device *op = qp->quattro_dev;
+		int qfe_slot, skip = 0;
+
+		for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) {
+			if (!qp->happy_meals[qfe_slot])
+				skip = 1;
+		}
+		if (skip)
+			continue;
 
 		free_irq(op->irqs[0], qp);
 	}
@@ -2828,6 +2847,9 @@
 	if (hp->tcvregs)
 		of_iounmap(&op->resource[4], hp->tcvregs, TCVR_REG_SIZE);
 
+	if (qp)
+		qp->happy_meals[qfe_slot] = NULL;
+
 err_out_free_netdev:
 	free_netdev(dev);
 
@@ -3285,7 +3307,7 @@
 
 	err = of_register_driver(&hme_sbus_driver, &of_bus_type);
 	if (!err)
-		quattro_sbus_register_irqs();
+		err = quattro_sbus_register_irqs();
 
 	return err;
 }
