]> git.ipfire.org Git - people/ms/u-boot.git/commit
mmc: fix response decoding on little endian
authorRabin Vincent <rabin@rab.in>
Sun, 5 Apr 2009 08:00:55 +0000 (13:30 +0530)
committerAndy Fleming <afleming@freescale.com>
Tue, 2 Jun 2009 22:18:57 +0000 (17:18 -0500)
commit0b453ffe28bb9227d86ddbe0893bd19c93f04ed7
tree30ca9a03cccd70c552d211512430fa3431b97c35
parent9b1f942c09dd942e6de3185caa81c111b14de567
mmc: fix response decoding on little endian

The mmc code defines the response as an array of chars.  However, it
access the response bytes both as (i) an array of four uints (with
casts) and (ii) as individual chars.  The former case is used more
often, including by the driver when it assigns the response.

The char-wise accesses are broken on little endian systems because they
assume that the bytes in the uints are in big endian byte order.

This patch fixes this by changing the response to be an array of four
uints and replacing the char-wise accesses with equivalent uint-wise
accesses.

Signed-off-by: Rabin Vincent <rabin@rab.in>
drivers/mmc/mmc.c
include/mmc.h