Skip to content

Commit

Permalink
spi/spi-atmel: call unmapping on transfers buffers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Ferre authored and Mark Brown committed Apr 1, 2013
1 parent 97ed465 commit 1888e8f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/spi/spi-atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down

0 comments on commit 1888e8f

Please sign in to comment.