Commit 96679f6b authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: kobil_sct: clean up kobil_set_termios

Kill string that is allocated and generated using speed and parity
settings but is never used (and never has been).
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 401711cb
...@@ -624,7 +624,6 @@ static void kobil_set_termios(struct tty_struct *tty, ...@@ -624,7 +624,6 @@ static void kobil_set_termios(struct tty_struct *tty,
unsigned short urb_val = 0; unsigned short urb_val = 0;
int c_cflag = tty->termios->c_cflag; int c_cflag = tty->termios->c_cflag;
speed_t speed; speed_t speed;
void *settings;
priv = usb_get_serial_port_data(port); priv = usb_get_serial_port_data(port);
if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID || if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
...@@ -647,25 +646,13 @@ static void kobil_set_termios(struct tty_struct *tty, ...@@ -647,25 +646,13 @@ static void kobil_set_termios(struct tty_struct *tty,
} }
urb_val |= (c_cflag & CSTOPB) ? SUSBCR_SPASB_2StopBits : urb_val |= (c_cflag & CSTOPB) ? SUSBCR_SPASB_2StopBits :
SUSBCR_SPASB_1StopBit; SUSBCR_SPASB_1StopBit;
settings = kzalloc(50, GFP_KERNEL);
if (!settings)
return;
sprintf(settings, "%d ", speed);
if (c_cflag & PARENB) { if (c_cflag & PARENB) {
if (c_cflag & PARODD) { if (c_cflag & PARODD)
urb_val |= SUSBCR_SPASB_OddParity; urb_val |= SUSBCR_SPASB_OddParity;
strcat(settings, "Odd Parity"); else
} else {
urb_val |= SUSBCR_SPASB_EvenParity; urb_val |= SUSBCR_SPASB_EvenParity;
strcat(settings, "Even Parity"); } else
}
} else {
urb_val |= SUSBCR_SPASB_NoParity; urb_val |= SUSBCR_SPASB_NoParity;
strcat(settings, "No Parity");
}
tty->termios->c_cflag &= ~CMSPAR; tty->termios->c_cflag &= ~CMSPAR;
tty_encode_baud_rate(tty, speed, speed); tty_encode_baud_rate(tty, speed, speed);
...@@ -675,11 +662,10 @@ static void kobil_set_termios(struct tty_struct *tty, ...@@ -675,11 +662,10 @@ static void kobil_set_termios(struct tty_struct *tty,
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT, USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
urb_val, urb_val,
0, 0,
settings, NULL,
0, 0,
KOBIL_TIMEOUT KOBIL_TIMEOUT
); );
kfree(settings);
} }
static int kobil_ioctl(struct tty_struct *tty, struct file *file, static int kobil_ioctl(struct tty_struct *tty, struct file *file,
......
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