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)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 18 May 2014 13:58:08 +0000 (14:58 +0100)
commit83ad4b788fc49cdc9fce56e4147c7cfde3d97c6a
treeee68747f29e3f7f95c7855ca4afcdcb352ae193d
parent42eb6ec92202136f18b50f69d1bec89c14badc60
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/io_ti.c