diff options
author | 2017-03-16 17:13:57 +0100 | |
---|---|---|
committer | 2017-03-28 11:14:13 +0200 | |
commit | 5e07240a12101af8481a90283da766905caf35f8 (patch) | |
tree | 7623060ec682beac7cdcf8913b3f497aedddc514 /drivers/usb/serial | |
parent | USB: serial: mxuport: clean up port bulk-out setup (diff) | |
download | linux-5e07240a12101af8481a90283da766905caf35f8.tar.gz linux-5e07240a12101af8481a90283da766905caf35f8.tar.bz2 linux-5e07240a12101af8481a90283da766905caf35f8.zip |
USB: serial: f81534: clean up calc_num_ports
Clean up calc_num_ports with respect to handling older chips that lack
config data.
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/f81534.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c index be106f4e3e57..365e3acd6c6c 100644 --- a/drivers/usb/serial/f81534.c +++ b/drivers/usb/serial/f81534.c @@ -681,12 +681,13 @@ static int f81534_calc_num_ports(struct usb_serial *serial, ++num_port; } - if (num_port) - return num_port; + if (!num_port) { + dev_warn(&serial->interface->dev, + "no config found, assuming 4 ports\n"); + num_port = 4; /* Nothing found, oldest version IC */ + } - dev_warn(&serial->interface->dev, "%s: Read Failed. default 4 ports\n", - __func__); - return 4; /* Nothing found, oldest version IC */ + return num_port; } static void f81534_set_termios(struct tty_struct *tty, |