aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/console.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 5b95009d2fbb..19e24045b137 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -241,12 +241,25 @@ static void usb_console_write(struct console *co,
241 } 241 }
242} 242}
243 243
244static struct tty_driver *usb_console_device(struct console *co, int *index)
245{
246 struct tty_driver **p = (struct tty_driver **)co->data;
247
248 if (!*p)
249 return NULL;
250
251 *index = co->index;
252 return *p;
253}
254
244static struct console usbcons = { 255static struct console usbcons = {
245 .name = "ttyUSB", 256 .name = "ttyUSB",
246 .write = usb_console_write, 257 .write = usb_console_write,
258 .device = usb_console_device,
247 .setup = usb_console_setup, 259 .setup = usb_console_setup,
248 .flags = CON_PRINTBUFFER, 260 .flags = CON_PRINTBUFFER,
249 .index = -1, 261 .index = -1,
262 .data = &usb_serial_tty_driver,
250}; 263};
251 264
252void usb_serial_console_disconnect(struct usb_serial *serial) 265void usb_serial_console_disconnect(struct usb_serial *serial)