spi: dw-mid: terminate ongoing transfers at exit
[pandora-kernel.git] / drivers / spi / spi-dw-mid.c
index 66026ec..c0ca0ee 100644 (file)
@@ -88,7 +88,13 @@ err_exit:
 
 static void mid_spi_dma_exit(struct dw_spi *dws)
 {
+       if (!dws->dma_inited)
+               return;
+
+       dmaengine_terminate_all(dws->txchan);
        dma_release_channel(dws->txchan);
+
+       dmaengine_terminate_all(dws->rxchan);
        dma_release_channel(dws->rxchan);
 }