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 20:20:31 +0000 (13:20 -0700)
commit4bb336c3ebbf8891a7f1a113eefa0abbd55f3ddd
treefc1319f38fdf4f1b4a419889e9f4a36edc4639ff
parent0cc0d1a3f00220c9f2542115b6dc2f2fc4b91616
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