summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-01-25 18:22:53 +0100
committerJohan Hovold <johan@kernel.org>2017-01-26 09:48:43 +0100
commit59556608139edda5aeeed5f73e435e8ddbb16516 (patch)
treee6d3f6c441eafd01c05d50eba1c31faf502a419b /drivers/usb
parentUSB: serial: ftdi_sio: fix extreme low-latency setting (diff)
downloadlinux-59556608139edda5aeeed5f73e435e8ddbb16516.tar.xz
linux-59556608139edda5aeeed5f73e435e8ddbb16516.zip
USB: serial: ftdi_sio: clean up ioctl handler
Clean up the ioctl handler and make sure to pass an unsigned-int rather than serial_struct pointer to the TIOCSERGETLSR helper as this it what the user argument really is. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/ftdi_sio.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 4bd556d9307d..e82dbb3d0883 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1534,7 +1534,7 @@ check_and_exit:
}
static int get_lsr_info(struct usb_serial_port *port,
- struct serial_struct __user *retinfo)
+ unsigned int __user *retinfo)
{
struct ftdi_private *priv = usb_get_serial_port_data(port);
unsigned int result = 0;
@@ -2485,20 +2485,15 @@ static int ftdi_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{
struct usb_serial_port *port = tty->driver_data;
+ void __user *argp = (void __user *)arg;
- /* Based on code from acm.c and others */
switch (cmd) {
-
- case TIOCGSERIAL: /* gets serial port data */
- return get_serial_info(port,
- (struct serial_struct __user *) arg);
-
- case TIOCSSERIAL: /* sets serial port data */
- return set_serial_info(tty, port,
- (struct serial_struct __user *) arg);
+ case TIOCGSERIAL:
+ return get_serial_info(port, argp);
+ case TIOCSSERIAL:
+ return set_serial_info(tty, port, argp);
case TIOCSERGETLSR:
- return get_lsr_info(port, (struct serial_struct __user *)arg);
- break;
+ return get_lsr_info(port, argp);
default:
break;
}