USB: io_ti: fix firmware download on big-endian machines
authorJohan Hovold <jhovold@gmail.com>
Fri, 25 Apr 2014 13:23:03 +0000 (15:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 May 2014 04:52:13 +0000 (21:52 -0700)
commit9e036f060793ddb0a9f3f70d4753877b85e894b4
tree9518f3e87b63eae33e07c8bb624908d50218a726
parent2eb1a584d440a3aed1b4793f39d091c1fff3f6d7
USB: io_ti: fix firmware download on big-endian machines

commit 5509076d1b4485ce9fb07705fcbcd2695907ab5b upstream.

During firmware download the device expects memory addresses in
big-endian byte order. As the wIndex parameter which hold the address is
sent in little-endian byte order regardless of host byte order, we need
to use swab16 rather than cpu_to_be16.

Also make sure to handle the struct ti_i2c_desc size parameter which is
returned in little-endian byte order.

Reported-by: Ludovic Drolez <ldrolez@debian.org>
Tested-by: Ludovic Drolez <ldrolez@debian.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/io_ti.c