summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/bcm2835.c
diff options
context:
space:
mode:
authorStefan Wahren <stefan.wahren@i2se.com>2018-11-11 21:23:58 +0100
committerUlf Hansson <ulf.hansson@linaro.org>2018-12-17 08:26:24 +0100
commit6dc6f2619017109e45550accc120f823fdc31c3e (patch)
tree76d1dc5b735e35aed0c4f7fe5b48e5498618a029 /drivers/mmc/host/bcm2835.c
parentmmc: bcm2835: Terminate timeout work synchronously (diff)
downloadlinux-6dc6f2619017109e45550accc120f823fdc31c3e.tar.xz
linux-6dc6f2619017109e45550accc120f823fdc31c3e.zip
mmc: bcm2835: Refactor dma_map_sg handling
There are two variables len within bcm2835_prepare_dma. So rename the result of dma_map_sg to sg_len. While we are at this add a bail out to simplify the following change. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to '')
-rw-r--r--drivers/mmc/host/bcm2835.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index a7961c391de6..7733dbd57073 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -453,7 +453,7 @@ static void bcm2835_transfer_pio(struct bcm2835_host *host)
static
void bcm2835_prepare_dma(struct bcm2835_host *host, struct mmc_data *data)
{
- int len, dir_data, dir_slave;
+ int sg_len, dir_data, dir_slave;
struct dma_async_tx_descriptor *desc = NULL;
struct dma_chan *dma_chan;
@@ -499,15 +499,13 @@ void bcm2835_prepare_dma(struct bcm2835_host *host, struct mmc_data *data)
&host->dma_cfg_rx :
&host->dma_cfg_tx);
- len = dma_map_sg(dma_chan->device->dev, data->sg, data->sg_len,
- dir_data);
+ sg_len = dma_map_sg(dma_chan->device->dev, data->sg, data->sg_len,
+ dir_data);
+ if (!sg_len)
+ return;
- if (len > 0) {
- desc = dmaengine_prep_slave_sg(dma_chan, data->sg,
- len, dir_slave,
- DMA_PREP_INTERRUPT |
- DMA_CTRL_ACK);
- }
+ desc = dmaengine_prep_slave_sg(dma_chan, data->sg, sg_len, dir_slave,
+ DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (desc) {
desc->callback = bcm2835_dma_complete;