Commit 2f5da678 authored by Stefan Wahren's avatar Stefan Wahren Committed by Ulf Hansson

mmc: bcm2835: Properly handle dmaengine_prep_slave_sg

In case dmaengine_prep_slave_sg fails we need to call dma_unmap_sg.
Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Acked-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 6dc6f261
...@@ -507,13 +507,16 @@ void bcm2835_prepare_dma(struct bcm2835_host *host, struct mmc_data *data) ...@@ -507,13 +507,16 @@ void bcm2835_prepare_dma(struct bcm2835_host *host, struct mmc_data *data)
desc = dmaengine_prep_slave_sg(dma_chan, data->sg, sg_len, dir_slave, desc = dmaengine_prep_slave_sg(dma_chan, data->sg, sg_len, dir_slave,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK); DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (desc) { if (!desc) {
desc->callback = bcm2835_dma_complete; dma_unmap_sg(dma_chan->device->dev, data->sg, sg_len, dir_data);
desc->callback_param = host; return;
host->dma_desc = desc;
host->dma_chan = dma_chan;
host->dma_dir = dir_data;
} }
desc->callback = bcm2835_dma_complete;
desc->callback_param = host;
host->dma_desc = desc;
host->dma_chan = dma_chan;
host->dma_dir = dir_data;
} }
static void bcm2835_start_dma(struct bcm2835_host *host) static void bcm2835_start_dma(struct bcm2835_host *host)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment