aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ftdi_sio.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2022-09-11 16:02:11 +0200
committerJohan Hovold <johan@kernel.org>2022-09-15 08:05:57 +0200
commit6fbd91425746f1df97145da31fb2177f7915479b (patch)
tree8469d0fdeb556def1f32d889839ad2c73ec8b86e /drivers/usb/serial/ftdi_sio.c
parentUSB: serial: ftdi_sio: tighten device-type detection (diff)
downloadlinux-dev-6fbd91425746f1df97145da31fb2177f7915479b.tar.xz
linux-dev-6fbd91425746f1df97145da31fb2177f7915479b.zip
USB: serial: ftdi_sio: clean up modem-status handling
All chip types but the original SIO (FT8U100AX) return a two-byte modem status and there's no need to explicitly list every other type in the handler. Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r--drivers/usb/serial/ftdi_sio.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 4d85cc7fadcb..eecd4b13a5ec 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2820,27 +2820,13 @@ static int ftdi_get_modem_status(struct usb_serial_port *port,
if (!buf)
return -ENOMEM;
/*
- * The 8U232AM returns a two byte value (the SIO a 1 byte value) in
- * the same format as the data returned from the in point.
+ * The device returns a two byte value (the SIO a 1 byte value) in the
+ * same format as the data returned from the IN endpoint.
*/
- switch (priv->chip_type) {
- case SIO:
+ if (priv->chip_type == SIO)
len = 1;
- break;
- case FT232A:
- case FT232B:
- case FT2232C:
- case FT232R:
- case FT2232H:
- case FT4232H:
- case FT232H:
- case FTX:
+ else
len = 2;
- break;
- default:
- ret = -EFAULT;
- goto out;
- }
ret = usb_control_msg(port->serial->dev,
usb_rcvctrlpipe(port->serial->dev, 0),