Skip to content

Commit

Permalink
USB: cp210x: fix up set_termios variables
Browse files Browse the repository at this point in the history
[Based on a patch from Johan, mangled by gregkh to keep things in line]

Fix up the variable usage in the set_termios call.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: Preston Fick <preston.fick@silabs.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Jan 24, 2012
1 parent 7f482fc commit 34b76fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/usb/serial/cp210x.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,8 @@ static void cp210x_set_termios(struct tty_struct *tty,
struct usb_serial_port *port, struct ktermios *old_termios)
{
unsigned int cflag, old_cflag;
unsigned int baud = 0, bits;
u32 baud;
unsigned int bits;
unsigned int modem_ctl[4];

dbg("%s - port %d", __func__, port->number);
Expand All @@ -596,7 +597,7 @@ static void cp210x_set_termios(struct tty_struct *tty,
if (baud != tty_termios_baud_rate(old_termios) && baud != 0) {
dbg("%s - Setting baud rate to %d baud", __func__,
baud);
if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud, 4)) {
if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud, sizeof(baud))) {
dbg("Baud rate requested not supported by device");
baud = tty_termios_baud_rate(old_termios);
}
Expand Down

0 comments on commit 34b76fc

Please sign in to comment.