Skip to contentSkip to conversation

SPARC: Handle request_irq() failure

PATCH In review Monakhov Dmitriy 2 participants 2 messages Feb 26, 2007 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 SPARC: Handle request_irq() failure

---
 drivers/sbus/char/uctrl.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/sbus/char/uctrl.c +7 -1
index 45cf5bc..6b96aa3 100644
@@ -364,6 +364,7 @@ static int __init ts102_uctrl_init(void)
 	struct linux_prom_irqs tmp_irq[2];
         unsigned int vaddr[2] = { 0, 0 };
 	int tmpnode, uctrlnode = prom_getchild(prom_root_node);
+	int err;
 
 	tmpnode = prom_searchsiblings(uctrlnode, "obio");
 
@@ -389,7 +390,12 @@ static int __init ts102_uctrl_init(void)
 	if(!driver->irq) 
 		driver->irq = tmp_irq[0].pri;
 
-	request_irq(driver->irq, uctrl_interrupt, 0, "uctrl", driver);
+	err = request_irq(driver->irq, uctrl_interrupt, 0, "uctrl", driver);
+	if (err) {
+		printk(KERN_ERR "%s: unable to request irq  %d\n",
+				__FUNCTION__, driver->irq);
+		return -EBUSY;
+	}
 
 	if (misc_register(&uctrl_dev)) {
 		printk("%s: unable to get misc minor %d\n",
Signature · 1 line
1.5.0.1
maintainer
#1 lore raw

From: Monakhov Dmitriy <[email protected]>
Date: Mon, 26 Feb 2007 19:09:27 +0300

Quoted 1 line

...

drivers/sbus/char/uctrl.c static int __init ts102_uctrl_init(void) · line 399

Quoted 12 lines
drivers/sbus/char/uctrl.c +6 -1
@@ -389,7 +390,12 @@ static int __init ts102_uctrl_init(void)
 	if(!driver->irq) 
 		driver->irq = tmp_irq[0].pri;
 
-	request_irq(driver->irq, uctrl_interrupt, 0, "uctrl", driver);
+	err = request_irq(driver->irq, uctrl_interrupt, 0, "uctrl", driver);
+	if (err) {
+		printk(KERN_ERR "%s: unable to request irq  %d\n",
+				__FUNCTION__, driver->irq);
+		return -EBUSY;
+	}
 

Why not return the error code that request_irq() gave us?

That's how I'll fix this bug.