mmc: cavium: Fix detection of block or byte addressing.
authorSteven J. Hill <Steven.Hill@cavium.com>
Mon, 24 Apr 2017 18:41:56 +0000 (13:41 -0500)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 24 Apr 2017 19:49:48 +0000 (21:49 +0200)
Use the mmc_card_is_blockaddr() function to properly detect if the
card uses byte or block addressing.

Signed-off-by: Steven J. Hill <Steven.Hill@cavium.com>
Acked-by: David Daney <david.daney@cavium.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/cavium.c

index d89c011bbea8bf334329ffd836ba94722899f775..58b51ba6aabd2de7773209d42aa758cb493c2500 100644 (file)
@@ -629,7 +629,7 @@ static u64 prepare_ext_dma(struct mmc_host *mmc, struct mmc_request *mrq)
 
        emm_dma = FIELD_PREP(MIO_EMM_DMA_VAL, 1) |
                  FIELD_PREP(MIO_EMM_DMA_SECTOR,
-                            (mrq->data->blksz == 512) ? 1 : 0) |
+                            mmc_card_is_blockaddr(mmc->card) ? 1 : 0) |
                  FIELD_PREP(MIO_EMM_DMA_RW,
                             (mrq->data->flags & MMC_DATA_WRITE) ? 1 : 0) |
                  FIELD_PREP(MIO_EMM_DMA_BLOCK_CNT, mrq->data->blocks) |