Add device funtion for usb serial console, so we can open /dev/console
when we use a usb serial device as console.
Signed-off-by: Kevin Hao <kexin.hao@xxxxxxxxxxxxx>
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 5b95009..1dbb203 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,
}
}
+static struct tty_driver *usb_console_device(struct console *co, int *index)
+{
+ struct tty_driver **p = (struct tty_driver **)co->data;
+
+ if (!*p)
+ return NULL;
+
+ *index = co->index;
+ return (struct tty_driver *)(*p);