[PATCH 5/5] Report serial ports without an IRQ correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Serial ports which have an IRQ set to NO_IRQ should report "polled" instead
of "irq = -1" or "irq = 0"

Signed-off-by: Matthew Wilcox <[email protected]>

---

 drivers/serial/serial_core.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

applies-to: aa693abc4cf3b02945bdfdec1ddf14352c8b89c7
d83c67ef7a731df90db77d44542fad00a70cab53
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 2331296..a63b268 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1961,6 +1961,7 @@ static inline void
 uart_report_port(struct uart_driver *drv, struct uart_port *port)
 {
 	char address[64];
+	char irq[16];
 
 	switch (port->iotype) {
 	case UPIO_PORT:
@@ -1982,10 +1983,16 @@ uart_report_port(struct uart_driver *drv
 		break;
 	}
 
-	printk(KERN_INFO "%s%s%s%d at %s (irq = %d) is a %s\n",
+	if (port->irq == NO_IRQ) {
+		strlcpy(irq, "polled", sizeof(irq));
+	} else {
+		snprintf(irq, sizeof(irq), "irq = %d", port->irq);
+	}
+
+	printk(KERN_INFO "%s%s%s%d at %s (%s) is a %s\n",
 	       port->dev ? port->dev->bus_id : "",
 	       port->dev ? ": " : "",
-	       drv->dev_name, port->line, address, port->irq, uart_type(port));
+	       drv->dev_name, port->line, address, irq, uart_type(port));
 }
 
 static void
---
0.99.8.GIT
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux