diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2013-03-19 08:44:22 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-01 15:42:43 +0200 |
commit | 1888e8f2f55c40656d8eff68572abb3748068b96 (patch) | |
tree | 7a5abf494746957716f2d5cf310b8028a3b40592 /drivers/spi/spi-atmel.c | |
parent | spi/spi-atmel: add support transfer on CS1,2,3, not only on CS0 (diff) | |
download | linux-1888e8f2f55c40656d8eff68572abb3748068b96.tar.xz linux-1888e8f2f55c40656d8eff68572abb3748068b96.zip |
spi/spi-atmel: call unmapping on transfers buffers
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/spi/spi-atmel.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index 26c126bfe02a..3c5ec603bcb0 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1047,6 +1047,7 @@ static int atmel_spi_remove(struct platform_device *pdev) struct spi_master *master = platform_get_drvdata(pdev); struct atmel_spi *as = spi_master_get_devdata(master); struct spi_message *msg; + struct spi_transfer *xfer; /* reset the hardware and block queue progress */ spin_lock_irq(&as->lock); @@ -1058,9 +1059,10 @@ static int atmel_spi_remove(struct platform_device *pdev) /* Terminate remaining queued transfers */ list_for_each_entry(msg, &as->queue, queue) { - /* REVISIT unmapping the dma is a NOP on ARM and AVR32 - * but we shouldn't depend on that... - */ + list_for_each_entry(xfer, &msg->transfers, transfer_list) { + if (!msg->is_dma_mapped) + atmel_spi_dma_unmap_xfer(master, xfer); + } msg->status = -ESHUTDOWN; msg->complete(msg->context); } |