aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/tmio-common.c
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2018-10-03 00:44:37 +0200
committerMarek Vasut <marex@denx.de>2018-10-09 17:21:43 +0200
commit92bde154ec91222c4d9a766052ab6dcdbf0cf410 (patch)
tree235f38cdfc1b7050bffcd55b5ae116222b3c0e60 /drivers/mmc/tmio-common.c
parent0a60a81ba3860946551cb79aa6486aa076e357f3 (diff)
downloadu-boot-92bde154ec91222c4d9a766052ab6dcdbf0cf410.zip
u-boot-92bde154ec91222c4d9a766052ab6dcdbf0cf410.tar.gz
u-boot-92bde154ec91222c4d9a766052ab6dcdbf0cf410.tar.bz2
mmc: tmio: Pass full address to tmio_sd_addr_is_dmaable()
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>
Diffstat (limited to 'drivers/mmc/tmio-common.c')
-rw-r--r--drivers/mmc/tmio-common.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/tmio-common.c b/drivers/mmc/tmio-common.c
index b311b80..6b21941 100644
--- a/drivers/mmc/tmio-common.c
+++ b/drivers/mmc/tmio-common.c
@@ -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);