From: Aristeu Rozanski Date: Mon, 12 Nov 2007 20:14:49 +0000 (-0500) Subject: USB: usb_serial_console: fix command line parsing X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=27680d232b04d434d8d49a8417429b9512ffb7c6;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git USB: usb_serial_console: fix command line parsing Currently usb serial console support ignores the device and always use ttyUSB0. Signed-off-by: Aristeu Rozanski Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 0362654d3b5..72ab3bbf0f2 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c @@ -133,11 +133,14 @@ static int usb_console_setup(struct console *co, char *options) } co->cflag = cflag; - /* grab the first serial port that happens to be connected */ - serial = usb_serial_get_by_index(0); + /* + * no need to check the index here: if the index is wrong, console + * code won't call us + */ + serial = usb_serial_get_by_index(co->index); if (serial == NULL) { /* no device is connected yet, sorry :( */ - err ("No USB device connected to ttyUSB0"); + err ("No USB device connected to ttyUSB%i", co->index); return -ENODEV; }