• Aristeu Rozanski's avatar
    USB: usb_serial_console: allocate fake tty and termios before calling driver open() method · c87d6a4f
    Aristeu Rozanski authored
    The usb serial method set_termios() is called for the first time from
    open() method in order to set up the termios structure with the default
    device's settings, ignoring the current settings. Once it's initialized,
    the next set_termios() calls will update the device with the
    tty->termios settings.
    Currently USB serial console code calls the driver open() method without
    a tty and after that will allocate a fake tty and termios so the command
    line arguments can be applied to the device
    (console=ttyUSB0,115200,...). This makes the driver overwrite the
    termios with the default settings and not applying the command line
    options.
    
    This patch changes usb_console_setup() to allocate the fake tty and
    termios before the open() method is called.
    
    Tested successfully with a pl2303
    Signed-off-by: default avatarAristeu Rozanski <arozansk@redhat.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    
    c87d6a4f
console.c 6.88 KB