Commit 0155ff5b authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: cp210x: fix up set_termios variables

commit 34b76fca upstream.

[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: default avatarJohan Hovold <jhovold@gmail.com>
Cc: Preston Fick <preston.fick@silabs.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ba8c8553
...@@ -576,7 +576,8 @@ static void cp210x_set_termios(struct tty_struct *tty, ...@@ -576,7 +576,8 @@ static void cp210x_set_termios(struct tty_struct *tty,
struct usb_serial_port *port, struct ktermios *old_termios) struct usb_serial_port *port, struct ktermios *old_termios)
{ {
unsigned int cflag, old_cflag; unsigned int cflag, old_cflag;
unsigned int baud = 0, bits; u32 baud;
unsigned int bits;
unsigned int modem_ctl[4]; unsigned int modem_ctl[4];
dbg("%s - port %d", __func__, port->number); dbg("%s - port %d", __func__, port->number);
...@@ -593,7 +594,7 @@ static void cp210x_set_termios(struct tty_struct *tty, ...@@ -593,7 +594,7 @@ static void cp210x_set_termios(struct tty_struct *tty,
if (baud != tty_termios_baud_rate(old_termios) && baud != 0) { if (baud != tty_termios_baud_rate(old_termios) && baud != 0) {
dbg("%s - Setting baud rate to %d baud", __func__, dbg("%s - Setting baud rate to %d baud", __func__,
baud); 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"); dbg("Baud rate requested not supported by device");
baud = tty_termios_baud_rate(old_termios); baud = tty_termios_baud_rate(old_termios);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment