diff options
author | George Spelvin <linux@horizon.com> | 2014-05-11 06:05:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-05-16 14:26:52 -0400 |
commit | 9b60fa4a876624f9b57db89ac8fc02b5fcc4f42e (patch) | |
tree | e597cf75e9bc91bbe02447a29cc37a2788e0ea03 | |
parent | 1836eea209546b870dd83f3f4ef234d6598a560d (diff) |
drivers/mmc/host/mmc_spi.c: Use get/put_unaligned_be32
Very minor source and binary size reduction.
Signed-off-by: George Spelvin <linux@horizon.com>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/mmc/host/mmc_spi.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c index 338e2202eaaa..cc8d4a6099cd 100644 --- a/drivers/mmc/host/mmc_spi.c +++ b/drivers/mmc/host/mmc_spi.c | |||
@@ -448,7 +448,6 @@ mmc_spi_command_send(struct mmc_spi_host *host, | |||
448 | { | 448 | { |
449 | struct scratch *data = host->data; | 449 | struct scratch *data = host->data; |
450 | u8 *cp = data->status; | 450 | u8 *cp = data->status; |
451 | u32 arg = cmd->arg; | ||
452 | int status; | 451 | int status; |
453 | struct spi_transfer *t; | 452 | struct spi_transfer *t; |
454 | 453 | ||
@@ -465,14 +464,12 @@ mmc_spi_command_send(struct mmc_spi_host *host, | |||
465 | * We init the whole buffer to all-ones, which is what we need | 464 | * We init the whole buffer to all-ones, which is what we need |
466 | * to write while we're reading (later) response data. | 465 | * to write while we're reading (later) response data. |
467 | */ | 466 | */ |
468 | memset(cp++, 0xff, sizeof(data->status)); | 467 | memset(cp, 0xff, sizeof(data->status)); |
469 | 468 | ||
470 | *cp++ = 0x40 | cmd->opcode; | 469 | cp[1] = 0x40 | cmd->opcode; |
471 | *cp++ = (u8)(arg >> 24); | 470 | put_unaligned_be32(cmd->arg, cp+2); |
472 | *cp++ = (u8)(arg >> 16); | 471 | cp[6] = crc7_be(0, cp+1, 5) | 0x01; |
473 | *cp++ = (u8)(arg >> 8); | 472 | cp += 7; |
474 | *cp++ = (u8)arg; | ||
475 | *cp++ = crc7_be(0, &data->status[1], 5) | 0x01; | ||
476 | 473 | ||
477 | /* Then, read up to 13 bytes (while writing all-ones): | 474 | /* Then, read up to 13 bytes (while writing all-ones): |
478 | * - N(CR) (== 1..8) bytes of all-ones | 475 | * - 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 | * so we have to cope with this situation and check the response | 708 | * so we have to cope with this situation and check the response |
712 | * bit-by-bit. Arggh!!! | 709 | * bit-by-bit. Arggh!!! |
713 | */ | 710 | */ |
714 | pattern = scratch->status[0] << 24; | 711 | pattern = get_unaligned_be32(scratch->status); |
715 | pattern |= scratch->status[1] << 16; | ||
716 | pattern |= scratch->status[2] << 8; | ||
717 | pattern |= scratch->status[3]; | ||
718 | 712 | ||
719 | /* First 3 bit of pattern are undefined */ | 713 | /* First 3 bit of pattern are undefined */ |
720 | pattern |= 0xE0000000; | 714 | pattern |= 0xE0000000; |