mmc: tmio: Pass full address to tmio_sd_addr_is_dmaable()
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Tue, 2 Oct 2018 22:44:37 +0000 (00:44 +0200)
committerMarek Vasut <marex@denx.de>
Tue, 9 Oct 2018 15:21:43 +0000 (17:21 +0200)
Pass the entire source data pointer to tmio_sd_addr_is_dmaable()
so we don't have to apply casts throughout the code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/mmc/tmio-common.c

index b311b80be8c2a8c53d14cec5f9456ba57e251ef3..6b2194199145ef883008be84b304d6b644898cee 100644 (file)
@@ -372,8 +372,10 @@ static int tmio_sd_dma_xfer(struct udevice *dev, struct mmc_data *data)
 }
 
 /* check if the address is DMA'able */
-static bool tmio_sd_addr_is_dmaable(unsigned long addr)
+static bool tmio_sd_addr_is_dmaable(const char *src)
 {
+       uintptr_t addr = (uintptr_t)src;
+
        if (!IS_ALIGNED(addr, TMIO_SD_DMA_MINALIGN))
                return false;
 
@@ -486,7 +488,7 @@ int tmio_sd_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
        if (data) {
                /* use DMA if the HW supports it and the buffer is aligned */
                if (priv->caps & TMIO_SD_CAP_DMA_INTERNAL &&
-                   tmio_sd_addr_is_dmaable((long)data->src))
+                   tmio_sd_addr_is_dmaable(data->src))
                        ret = tmio_sd_dma_xfer(dev, data);
                else
                        ret = tmio_sd_pio_xfer(dev, data);