Commit 9b60fa4a authored by George Spelvin's avatar George Spelvin Committed by John W. Linville

drivers/mmc/host/mmc_spi.c: Use get/put_unaligned_be32

Very minor source and binary size reduction.
Signed-off-by: default avatarGeorge Spelvin <linux@horizon.com>
Reviewed-by: default avatarPavel Machek <pavel@ucw.cz>
Reviewed-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Acked-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1836eea2
...@@ -448,7 +448,6 @@ mmc_spi_command_send(struct mmc_spi_host *host, ...@@ -448,7 +448,6 @@ mmc_spi_command_send(struct mmc_spi_host *host,
{ {
struct scratch *data = host->data; struct scratch *data = host->data;
u8 *cp = data->status; u8 *cp = data->status;
u32 arg = cmd->arg;
int status; int status;
struct spi_transfer *t; struct spi_transfer *t;
...@@ -465,14 +464,12 @@ mmc_spi_command_send(struct mmc_spi_host *host, ...@@ -465,14 +464,12 @@ mmc_spi_command_send(struct mmc_spi_host *host,
* We init the whole buffer to all-ones, which is what we need * We init the whole buffer to all-ones, which is what we need
* to write while we're reading (later) response data. * to write while we're reading (later) response data.
*/ */
memset(cp++, 0xff, sizeof(data->status)); memset(cp, 0xff, sizeof(data->status));
*cp++ = 0x40 | cmd->opcode; cp[1] = 0x40 | cmd->opcode;
*cp++ = (u8)(arg >> 24); put_unaligned_be32(cmd->arg, cp+2);
*cp++ = (u8)(arg >> 16); cp[6] = crc7_be(0, cp+1, 5) | 0x01;
*cp++ = (u8)(arg >> 8); cp += 7;
*cp++ = (u8)arg;
*cp++ = crc7_be(0, &data->status[1], 5) | 0x01;
/* Then, read up to 13 bytes (while writing all-ones): /* Then, read up to 13 bytes (while writing all-ones):
* - N(CR) (== 1..8) bytes of all-ones * - N(CR) (== 1..8) bytes of all-ones
...@@ -711,10 +708,7 @@ mmc_spi_writeblock(struct mmc_spi_host *host, struct spi_transfer *t, ...@@ -711,10 +708,7 @@ mmc_spi_writeblock(struct mmc_spi_host *host, struct spi_transfer *t,
* so we have to cope with this situation and check the response * so we have to cope with this situation and check the response
* bit-by-bit. Arggh!!! * bit-by-bit. Arggh!!!
*/ */
pattern = scratch->status[0] << 24; pattern = get_unaligned_be32(scratch->status);
pattern |= scratch->status[1] << 16;
pattern |= scratch->status[2] << 8;
pattern |= scratch->status[3];
/* First 3 bit of pattern are undefined */ /* First 3 bit of pattern are undefined */
pattern |= 0xE0000000; pattern |= 0xE0000000;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment