Skip to contentSkip to conversation

ARM: request_irq() failure ignored in omap_uart_enable_irqs()

PATCH New Aguirre Rodriguez, Sergio Alberto 1 participant 1 message Sep 2, 2009 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH 1/1 ARM: request_irq() failure ignored in omap_uart_enable_irqs()

(Resending to new ML)

From: Roel Kluin [mailto:roel.kluin at gmail.com]
Sent: Tuesday, September 01, 2009 12:18 PM

arch/arm/mach-omap2/serial.c void omap_uart_enable_irqs(int enable)

Quoted 5 lines
arch/arm/mach-omap2/serial.c +0 -0
index a7421a5..ed683d9 100644
@@ -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

Quoted 29 lines
arch/arm/mach-omap2/serial.c +10 -3
 	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