Commit 1888e8f2 authored by Nicolas Ferre's avatar Nicolas Ferre Committed by Mark Brown

spi/spi-atmel: call unmapping on transfers buffers

Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarWenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 97ed465b
...@@ -1047,6 +1047,7 @@ static int atmel_spi_remove(struct platform_device *pdev) ...@@ -1047,6 +1047,7 @@ static int atmel_spi_remove(struct platform_device *pdev)
struct spi_master *master = platform_get_drvdata(pdev); struct spi_master *master = platform_get_drvdata(pdev);
struct atmel_spi *as = spi_master_get_devdata(master); struct atmel_spi *as = spi_master_get_devdata(master);
struct spi_message *msg; struct spi_message *msg;
struct spi_transfer *xfer;
/* reset the hardware and block queue progress */ /* reset the hardware and block queue progress */
spin_lock_irq(&as->lock); spin_lock_irq(&as->lock);
...@@ -1058,9 +1059,10 @@ static int atmel_spi_remove(struct platform_device *pdev) ...@@ -1058,9 +1059,10 @@ static int atmel_spi_remove(struct platform_device *pdev)
/* Terminate remaining queued transfers */ /* Terminate remaining queued transfers */
list_for_each_entry(msg, &as->queue, queue) { list_for_each_entry(msg, &as->queue, queue) {
/* REVISIT unmapping the dma is a NOP on ARM and AVR32 list_for_each_entry(xfer, &msg->transfers, transfer_list) {
* but we shouldn't depend on that... if (!msg->is_dma_mapped)
*/ atmel_spi_dma_unmap_xfer(master, xfer);
}
msg->status = -ESHUTDOWN; msg->status = -ESHUTDOWN;
msg->complete(msg->context); msg->complete(msg->context);
} }
......
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