]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: ftdi_sio: fix endianess of max packet size
authorMichael Wileczka <mikewileczka@yahoo.com>
Wed, 18 Aug 2010 14:14:37 +0000 (07:14 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Aug 2010 23:41:57 +0000 (16:41 -0700)
commit d1ab903d2552b2362339b19203c7f01c797cb316 upstream.

The USB max packet size (always little-endian) was not being byte
swapped on big-endian systems.

Applicable since [USB: ftdi_sio: fix hi-speed device packet size calculation] approx 2.6.31

Signed-off-by: Michael Wileczka <mikewileczka@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/ftdi_sio.c

index b2353a9e6539fdf9ce02236ddb448cff4449291c..7d3d9371013211c56e3620d53d64b6ae189295ee 100644 (file)
@@ -1410,7 +1410,7 @@ static void ftdi_set_max_packet_size(struct usb_serial_port *port)
        }
 
        /* set max packet size based on descriptor */
-       priv->max_packet_size = ep_desc->wMaxPacketSize;
+       priv->max_packet_size = le16_to_cpu(ep_desc->wMaxPacketSize);
 
        dev_info(&udev->dev, "Setting MaxPacketSize %d\n", priv->max_packet_size);
 }