lkml.org 
[lkml]   [2020]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/6] dmaengine: mxs: add the remove function
Date
add the remove function for mxs-dma

Signed-off-by: Han Xu <han.xu@nxp.com>
---
drivers/dma/mxs-dma.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 9deaaf4fc58f..b458f06f9067 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -863,6 +863,22 @@ static int mxs_dma_probe(struct platform_device *pdev)
return 0;
}

+static int mxs_dma_remove(struct platform_device *pdev)
+{
+ struct mxs_dma_engine *mxs_dma = platform_get_drvdata(pdev);
+ int i;
+
+ dma_async_device_unregister(&mxs_dma->dma_device);
+
+ for (i = 0; i < MXS_DMA_CHANNELS; i++) {
+ struct mxs_dma_chan *mxs_chan = &mxs_dma->mxs_chans[i];
+
+ tasklet_kill(&mxs_chan->tasklet);
+ }
+
+ return 0;
+}
+
static struct platform_driver mxs_dma_driver = {
.driver = {
.name = "mxs-dma",
@@ -870,6 +886,7 @@ static struct platform_driver mxs_dma_driver = {
},
.id_table = mxs_dma_ids,
.probe = mxs_dma_probe,
+ .remove = mxs_dma_remove,
};

module_platform_driver(mxs_dma_driver);
--
2.17.1
\
 
 \ /
  Last update: 2020-01-14 22:49    [W:0.071 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site