提交 54f328d0 编写于 作者: J Johan Hovold 提交者: Greg Kroah-Hartman

USB: ftdi_sio: fix latency-timeout endianess bug

Also fixes DMA transfer to stack for latency buffer.
Signed-off-by: NJohan Hovold <jhovold@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 4357369d
...@@ -1181,22 +1181,28 @@ static int read_latency_timer(struct usb_serial_port *port) ...@@ -1181,22 +1181,28 @@ static int read_latency_timer(struct usb_serial_port *port)
{ {
struct ftdi_private *priv = usb_get_serial_port_data(port); struct ftdi_private *priv = usb_get_serial_port_data(port);
struct usb_device *udev = port->serial->dev; struct usb_device *udev = port->serial->dev;
unsigned short latency = 0; unsigned char *buf;
int rv = 0; int rv = 0;
dbg("%s", __func__); dbg("%s", __func__);
buf = kmalloc(1, GFP_KERNEL);
if (!buf)
return -ENOMEM;
rv = usb_control_msg(udev, rv = usb_control_msg(udev,
usb_rcvctrlpipe(udev, 0), usb_rcvctrlpipe(udev, 0),
FTDI_SIO_GET_LATENCY_TIMER_REQUEST, FTDI_SIO_GET_LATENCY_TIMER_REQUEST,
FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE, FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE,
0, priv->interface, 0, priv->interface,
(char *) &latency, 1, WDR_TIMEOUT); buf, 1, WDR_TIMEOUT);
if (rv < 0) if (rv < 0)
dev_err(&port->dev, "Unable to read latency timer: %i\n", rv); dev_err(&port->dev, "Unable to read latency timer: %i\n", rv);
else else
priv->latency = latency; priv->latency = buf[0];
kfree(buf);
return rv; return rv;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册