diff options
author | Vinod Koul <vinod.koul@linux.intel.com> | 2011-10-14 01:15:11 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2011-10-31 00:10:25 -0400 |
commit | 05f5799cbe5c9e2c03f604b3de5783cf4d726227 (patch) | |
tree | c70394eb8154fb5e717168af98889631078789e7 /drivers/mmc/host/mmci.c | |
parent | 1d0c81e876fe04295ef5df387ba057bf9cfae3d8 (diff) |
mmc-host: move to dma_transfer_direction
fixup usage of dma direction by introducing dma_transfer_direction,
this patch moves mmc drivers to use new enum
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Chris Ball <cjb@laptop.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/mmc/host/mmci.c')
-rw-r--r-- | drivers/mmc/host/mmci.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 56e9a4168264..3abd51a9fec1 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -372,6 +372,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data, | |||
372 | struct dma_chan *chan; | 372 | struct dma_chan *chan; |
373 | struct dma_device *device; | 373 | struct dma_device *device; |
374 | struct dma_async_tx_descriptor *desc; | 374 | struct dma_async_tx_descriptor *desc; |
375 | enum dma_data_direction buffer_dirn; | ||
375 | int nr_sg; | 376 | int nr_sg; |
376 | 377 | ||
377 | /* Check if next job is already prepared */ | 378 | /* Check if next job is already prepared */ |
@@ -385,10 +386,12 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data, | |||
385 | } | 386 | } |
386 | 387 | ||
387 | if (data->flags & MMC_DATA_READ) { | 388 | if (data->flags & MMC_DATA_READ) { |
388 | conf.direction = DMA_FROM_DEVICE; | 389 | conf.direction = DMA_DEV_TO_MEM; |
390 | buffer_dirn = DMA_FROM_DEVICE; | ||
389 | chan = host->dma_rx_channel; | 391 | chan = host->dma_rx_channel; |
390 | } else { | 392 | } else { |
391 | conf.direction = DMA_TO_DEVICE; | 393 | conf.direction = DMA_MEM_TO_DEV; |
394 | buffer_dirn = DMA_TO_DEVICE; | ||
392 | chan = host->dma_tx_channel; | 395 | chan = host->dma_tx_channel; |
393 | } | 396 | } |
394 | 397 | ||
@@ -401,7 +404,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data, | |||
401 | return -EINVAL; | 404 | return -EINVAL; |
402 | 405 | ||
403 | device = chan->device; | 406 | device = chan->device; |
404 | nr_sg = dma_map_sg(device->dev, data->sg, data->sg_len, conf.direction); | 407 | nr_sg = dma_map_sg(device->dev, data->sg, data->sg_len, buffer_dirn); |
405 | if (nr_sg == 0) | 408 | if (nr_sg == 0) |
406 | return -EINVAL; | 409 | return -EINVAL; |
407 | 410 | ||
@@ -424,7 +427,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data, | |||
424 | unmap_exit: | 427 | unmap_exit: |
425 | if (!next) | 428 | if (!next) |
426 | dmaengine_terminate_all(chan); | 429 | dmaengine_terminate_all(chan); |
427 | dma_unmap_sg(device->dev, data->sg, data->sg_len, conf.direction); | 430 | dma_unmap_sg(device->dev, data->sg, data->sg_len, buffer_dirn); |
428 | return -ENOMEM; | 431 | return -ENOMEM; |
429 | } | 432 | } |
430 | 433 | ||