diff options
author | David S. Miller <davem@davemloft.net> | 2008-10-13 05:45:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-13 12:51:44 -0400 |
commit | 8440838bc5337243917f13bc14ea2445da5e0197 (patch) | |
tree | 175af8fd7d678073a9794248132b606fb536c887 /drivers/serial/serial_core.c | |
parent | a7be18d436f0c7007794965e5af29fa1ffff1e05 (diff) |
serial: fix device name reporting when minor space is shared between drivers
The multiple drivers share the minor space occupied by a particular major
number, the actual index within the device name's space is indicated by
the tty_driver->name_base + uart_port->line
Another usable formula is (uart_driver->minor - MINOR_BASE) + port->line
Use those to print the device names properly in such situations in
serial_core.c and 8250.c
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial/serial_core.c')
-rw-r--r-- | drivers/serial/serial_core.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 308588e2072..6bdf3362e3b 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -2051,7 +2051,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) | |||
2051 | "transmitter\n", | 2051 | "transmitter\n", |
2052 | port->dev ? port->dev->bus_id : "", | 2052 | port->dev ? port->dev->bus_id : "", |
2053 | port->dev ? ": " : "", | 2053 | port->dev ? ": " : "", |
2054 | drv->dev_name, port->line); | 2054 | drv->dev_name, |
2055 | drv->tty_driver->name_base + port->line); | ||
2055 | 2056 | ||
2056 | ops->shutdown(port); | 2057 | ops->shutdown(port); |
2057 | } | 2058 | } |
@@ -2176,7 +2177,9 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port) | |||
2176 | printk(KERN_INFO "%s%s%s%d at %s (irq = %d) is a %s\n", | 2177 | printk(KERN_INFO "%s%s%s%d at %s (irq = %d) is a %s\n", |
2177 | port->dev ? port->dev->bus_id : "", | 2178 | port->dev ? port->dev->bus_id : "", |
2178 | port->dev ? ": " : "", | 2179 | port->dev ? ": " : "", |
2179 | drv->dev_name, port->line, address, port->irq, uart_type(port)); | 2180 | drv->dev_name, |
2181 | drv->tty_driver->name_base + port->line, | ||
2182 | address, port->irq, uart_type(port)); | ||
2180 | } | 2183 | } |
2181 | 2184 | ||
2182 | static void | 2185 | static void |