aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-24 10:55:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-24 10:55:29 -0400
commita487b6705a811087c182c8cab7e3b5845dfa6ccb (patch)
treec9c1e41b7105b5ac9de7a74416d15f12433ed6ff /drivers/mmc
parent9f6ac7850a9c6363f4117fd2248e232a2d534627 (diff)
parent4b3df5668c8ebaebd8d66a5a94374be3e3b2ef0c (diff)
Merge branch 'for-linus' of git://neil.brown.name/md
* 'for-linus' of git://neil.brown.name/md: (97 commits) md: raid-1/10: fix RW bits manipulation md: remove unnecessary memset from multipath. md: report device as congested when suspended md: Improve name of threads created by md_register_thread md: remove sparse warnings about lock context. md: remove sparse waring "symbol xxx shadows an earlier one" async_tx/raid6: add missing dma_unmap calls to the async fail case ioat3: fix uninitialized var warnings drivers/dma/ioat/dma_v2.c: fix warnings raid6test: fix stack overflow ioat2: clarify ring size limits md/raid6: cleanup ops_run_compute6_2 md/raid6: eliminate BUG_ON with side effect dca: module load should not be an error message ioat: driver version 4.0 dca: registering requesters in multiple dca domains async_tx: remove HIGHMEM64G restriction dmaengine: sh: Add Support SuperH DMA Engine driver dmaengine: Move all map_sg/unmap_sg for slave channel to its client fsldma: Add DMA_SLAVE support ...
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/atmel-mci.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 065fa818be57..fc25586b7ee1 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -599,6 +599,7 @@ atmci_submit_data_dma(struct atmel_mci *host, struct mmc_data *data)
599 struct scatterlist *sg; 599 struct scatterlist *sg;
600 unsigned int i; 600 unsigned int i;
601 enum dma_data_direction direction; 601 enum dma_data_direction direction;
602 unsigned int sglen;
602 603
603 /* 604 /*
604 * We don't do DMA on "complex" transfers, i.e. with 605 * We don't do DMA on "complex" transfers, i.e. with
@@ -628,11 +629,14 @@ atmci_submit_data_dma(struct atmel_mci *host, struct mmc_data *data)
628 else 629 else
629 direction = DMA_TO_DEVICE; 630 direction = DMA_TO_DEVICE;
630 631
632 sglen = dma_map_sg(&host->pdev->dev, data->sg, data->sg_len, direction);
633 if (sglen != data->sg_len)
634 goto unmap_exit;
631 desc = chan->device->device_prep_slave_sg(chan, 635 desc = chan->device->device_prep_slave_sg(chan,
632 data->sg, data->sg_len, direction, 636 data->sg, data->sg_len, direction,
633 DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 637 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
634 if (!desc) 638 if (!desc)
635 return -ENOMEM; 639 goto unmap_exit;
636 640
637 host->dma.data_desc = desc; 641 host->dma.data_desc = desc;
638 desc->callback = atmci_dma_complete; 642 desc->callback = atmci_dma_complete;
@@ -643,6 +647,9 @@ atmci_submit_data_dma(struct atmel_mci *host, struct mmc_data *data)
643 chan->device->device_issue_pending(chan); 647 chan->device->device_issue_pending(chan);
644 648
645 return 0; 649 return 0;
650unmap_exit:
651 dma_unmap_sg(&host->pdev->dev, data->sg, sglen, direction);
652 return -ENOMEM;
646} 653}
647 654
648#else /* CONFIG_MMC_ATMELMCI_DMA */ 655#else /* CONFIG_MMC_ATMELMCI_DMA */