Thread (1 message) 1 message, 1 author, 2009-09-02
DORMANTno replies

[PATCH] ARM: request_irq() failure ignored in omap_uart_enable_irqs()

From: Aguirre Rodriguez, Sergio Alberto <hidden>
Date: 2009-09-02 12:21:47

(Resending to new ML)

From: Roel Kluin [mailto:roel.kluin at gmail.com]
Sent: Tuesday, September 01, 2009 12:18 PM
quoted hunk
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index a7421a5..ed683d9 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -471,11 +471,18 @@ void omap_uart_enable_irqs(int enable)
Wouldn't it make more sense to return int, instead of void here?

The caller would never know if the call internally failed.

Just a thought...

Regards,
Sergio
 	int ret;
 	struct omap_uart_state *uart;

-	list_for_each_entry(uart, &uart_list, node) {
-		if (enable)
+	if (enable) {
+		list_for_each_entry(uart, &uart_list, node) {
 			ret = request_irq(uart->p->irq, omap_uart_interrupt,
 				IRQF_SHARED, "serial idle", (void *)uart);
-		else
+			if (ret < 0) {
+				printk(KERN_ERR "omap_uart_enable_irqs: failed to
request IRQ%i (%i)\n",
+						uart->p->irq, ret);
+				return;
+			}
+		}
+	} else {
+		list_for_each_entry(uart, &uart_list, node)
 			free_irq(uart->p->irq, (void *)uart);
 	}
 }


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-
kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help