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)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 May 2014 09:38:20 +0000 (11:38 +0200)
commitcc5aeeb5c66a30b9be357ccec62f51b29b136606
tree4abe4c8533f979d76569abeef1fda404d2f900a6
parente53acf9754734aa0d58686494f640c00445316c3
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: Jiri Slaby <jslaby@suse.cz>
drivers/usb/serial/io_ti.c