Commit 2dea7cd7 authored by Ian Abbott's avatar Ian Abbott Committed by Johan Hovold

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: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 4495c08e
...@@ -1406,6 +1406,9 @@ static int write_latency_timer(struct usb_serial_port *port) ...@@ -1406,6 +1406,9 @@ static int write_latency_timer(struct usb_serial_port *port)
int rv; int rv;
int l = priv->latency; int l = priv->latency;
if (priv->chip_type == SIO || priv->chip_type == FT8U232AM)
return -EINVAL;
if (priv->flags & ASYNC_LOW_LATENCY) if (priv->flags & ASYNC_LOW_LATENCY)
l = 1; l = 1;
...@@ -1429,6 +1432,9 @@ static int read_latency_timer(struct usb_serial_port *port) ...@@ -1429,6 +1432,9 @@ static int read_latency_timer(struct usb_serial_port *port)
unsigned char *buf; unsigned char *buf;
int rv; int rv;
if (priv->chip_type == SIO || priv->chip_type == FT8U232AM)
return -EINVAL;
buf = kmalloc(1, GFP_KERNEL); buf = kmalloc(1, GFP_KERNEL);
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
......
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