Commit d3f819b3 authored by Matthieu Cattin's avatar Matthieu Cattin

sw: Bug fix in cp210x driver. Takes ioctl argument without treatment.

parent 1a316288
...@@ -521,16 +521,12 @@ static int cp210x_ioctl(struct tty_struct *tty, struct file *file, ...@@ -521,16 +521,12 @@ static int cp210x_ioctl(struct tty_struct *tty, struct file *file,
case IOCTL_GPIOSET: case IOCTL_GPIOSET:
if ((port_priv->bPartNumber == CP2103_PARTNUM) || if ((port_priv->bPartNumber == CP2103_PARTNUM) ||
(port_priv->bPartNumber == CP2104_PARTNUM)) { (port_priv->bPartNumber == CP2104_PARTNUM)) {
latch_mask_setting_to_write =
*(unsigned int*)arg & 0x000000FF;
latch_mask_setting_to_write |=
(*(unsigned int*)arg & 0x00FF0000) >> 8;
result = usb_control_msg(port->serial->dev, result = usb_control_msg(port->serial->dev,
usb_sndctrlpipe(port->serial->dev, 0), usb_sndctrlpipe(port->serial->dev, 0),
CP210X_VENDOR_SPECIFIC, CP210X_VENDOR_SPECIFIC,
REQTYPE_HOST_TO_DEVICE, REQTYPE_HOST_TO_DEVICE,
CP210X_WRITE_LATCH, CP210X_WRITE_LATCH,
latch_mask_setting_to_write, *(unsigned int*)arg,
NULL, 0, 300); NULL, 0, 300);
if (result != 0) { if (result != 0) {
return -EPROTO; return -EPROTO;
......
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