Skip to content

Commit

Permalink
USB: serial: f81534: clean up calc_num_ports
Browse files Browse the repository at this point in the history
Clean up calc_num_ports with respect to handling older chips that lack
config data.

Signed-off-by: Johan Hovold <johan@kernel.org>
  • Loading branch information
Johan Hovold committed Mar 28, 2017
1 parent d69f138 commit 5e07240
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/usb/serial/f81534.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5e07240

Please sign in to comment.