public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Cc: Matthew Wilcox <matthew@wil.cx>, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	Russell King <rmk+serial@arm.linux.org.uk>
Subject: [PATCH 5/5] Report serial ports without an IRQ correctly
Date: Tue, 22 Nov 2005 00:19:13 -0500	[thread overview]
Message-ID: <E1EeQYj-00055y-2F@localhost.localdomain> (raw)

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 <matthew@wil.cx>

---

 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

             reply	other threads:[~2005-11-22  5:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-22  5:19 Matthew Wilcox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-11-21  1:14 [PATCH 5/5] Report serial ports without an IRQ correctly Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1EeQYj-00055y-2F@localhost.localdomain \
    --to=matthew@wil.cx \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rmk+serial@arm.linux.org.uk \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox