From 8440838bc5337243917f13bc14ea2445da5e0197 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 13 Oct 2008 10:45:26 +0100 Subject: 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 Signed-off-by: Andrew Morton Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/serial/serial_core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/serial/serial_core.c') 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) "transmitter\n", port->dev ? port->dev->bus_id : "", port->dev ? ": " : "", - drv->dev_name, port->line); + drv->dev_name, + drv->tty_driver->name_base + port->line); ops->shutdown(port); } @@ -2176,7 +2177,9 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port) printk(KERN_INFO "%s%s%s%d at %s (irq = %d) 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, + drv->tty_driver->name_base + port->line, + address, port->irq, uart_type(port)); } static void -- cgit v1.2.3-18-g5258