提交 27680d23 编写于 作者: A Aristeu Rozanski 提交者: Greg Kroah-Hartman

USB: usb_serial_console: fix command line parsing

Currently usb serial console support ignores the device and always use
ttyUSB0.
Signed-off-by: NAristeu Rozanski <arozansk@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 d09d6a35
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册