aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ftdi_sio.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2017-03-08 11:02:57 -0500
committerJohan Hovold <johan@kernel.org>2017-03-13 11:13:48 -0400
commit2dea7cd7287781cd4bfd0167dba423e0f486ef61 (patch)
treeb7936e359cade511ba269ffd27a7ad52734e85ac /drivers/usb/serial/ftdi_sio.c
parent4495c08e84729385774601b5146d51d9e5849f81 (diff)
USB: serial: ftdi_sio: don't access latency timer on old chips
The latency timer was introduced with the FT232BM and FT245BM chips. Do not bother attempting to read or write it for older chip versions. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> 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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index c540de15aad2..72314734dfd0 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1406,6 +1406,9 @@ static int write_latency_timer(struct usb_serial_port *port)
1406 int rv; 1406 int rv;
1407 int l = priv->latency; 1407 int l = priv->latency;
1408 1408
1409 if (priv->chip_type == SIO || priv->chip_type == FT8U232AM)
1410 return -EINVAL;
1411
1409 if (priv->flags & ASYNC_LOW_LATENCY) 1412 if (priv->flags & ASYNC_LOW_LATENCY)
1410 l = 1; 1413 l = 1;
1411 1414
@@ -1429,6 +1432,9 @@ static int read_latency_timer(struct usb_serial_port *port)
1429 unsigned char *buf; 1432 unsigned char *buf;
1430 int rv; 1433 int rv;
1431 1434
1435 if (priv->chip_type == SIO || priv->chip_type == FT8U232AM)
1436 return -EINVAL;
1437
1432 buf = kmalloc(1, GFP_KERNEL); 1438 buf = kmalloc(1, GFP_KERNEL);
1433 if (!buf) 1439 if (!buf)
1434 return -ENOMEM; 1440 return -ENOMEM;