[PATCH] b44: fix eeprom endianess issue
[PATCH] b44: fix eeprom endianess issue

This fixes eeprom read on big-endian architectures.

readw returns the data in CPU order.  With cpu_to_le16 we convert it to little
endian, because "ptr" is a pointer to a _byte_ arrray.  See the cast above.  A
byte array is little endian.

The bug is:

Reading u16 values with readw, casting them into an u8 array and accessing
this u8 array as an u8 (byte) array.  The correct fix is to swap the
CPU-ordering value returned by readw into little endian, as the u8 array is
little endian.

This compiles to nothing on little endian hardware (so it does not change b44
code on LE hardware), but _fixes_ code on BE hardware.

Signed-off-by: Michael Buesch <77666125932addc6fc525b281b518fd8fd2203d8@bu3sch.de>
Cc: Jeff Garzik <f3e731dfa293c7a83119d8aacfa41b5d2d780be9@garzik.org>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Jeff Garzik <f3e731dfa293c7a83119d8aacfa41b5d2d780be9@garzik.org>

TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs