summaryrefslogtreecommitdiff
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-01-16 00:36:49 +0100
committerSimone Willett <swillett@nvidia.com>2012-02-08 14:32:23 -0800
commitcae9fcc14258b7b3844b4416985c27bd3212ee67 (patch)
tree0da318ef1cb4cefcb2fa4fafe920ae5268bf1ee1 /drivers/usb/serial
parent08e96eb683c5443400a8e591e77ed10b5a8261ea (diff)
USB: cp210x: fix up set_termios variables
commit 34b76fcaee574017862ea3fa0efdcd77a9d0e57d 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: Johan Hovold <jhovold@gmail.com> Cc: Preston Fick <preston.fick@silabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Change-Id: I42e7a0665e4c8bd4bcadad75141a307aaec11868 Reviewed-on: http://git-master/r/79702 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/cp210x.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 1bac7b9223f2..5c3b7d1c25a5 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -576,7 +576,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);
@@ -593,7 +594,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);
}