Skip to content

Commit

Permalink
USB: usb_serial_console: fix command line parsing
Browse files Browse the repository at this point in the history
Currently usb serial console support ignores the device and always use
ttyUSB0.

Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Aristeu Rozanski authored and Greg Kroah-Hartman committed Feb 1, 2008
1 parent d09d6a3 commit 27680d2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/usb/serial/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 27680d2

Please sign in to comment.