summaryrefslogtreecommitdiffstats
path: root/drivers/dma/dmaengine.c
diff options
context:
space:
mode:
authorVinod Koul <vkoul@kernel.org>2019-12-24 05:52:15 +0100
committerVinod Koul <vkoul@kernel.org>2019-12-26 05:33:55 +0100
commit83c77940db12112646a2f74d1d21505788812d7f (patch)
tree0533abeafcc4a77f814854b42fe351b939a3e189 /drivers/dma/dmaengine.c
parentdmaengine: ioat: Support in-use unbind (diff)
downloadlinux-83c77940db12112646a2f74d1d21505788812d7f.tar.xz
linux-83c77940db12112646a2f74d1d21505788812d7f.zip
dmaengine: move module_/dma_device_put() after route free
We call dma_device_put() and module_put() after invoking .device_free_chan_resources callback, but we should also take care of router devices and invoke this after .route_free callback. So move it after .route_free Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/dmaengine.c')
-rw-r--r--drivers/dma/dmaengine.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index e316abe3672d..0505ea5b002f 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -427,15 +427,15 @@ static void dma_chan_put(struct dma_chan *chan)
chan->device->device_free_chan_resources(chan);
}
- dma_device_put(chan->device);
- module_put(dma_chan_to_owner(chan));
-
/* If the channel is used via a DMA request router, free the mapping */
if (chan->router && chan->router->route_free) {
chan->router->route_free(chan->router->dev, chan->route_data);
chan->router = NULL;
chan->route_data = NULL;
}
+
+ dma_device_put(chan->device);
+ module_put(dma_chan_to_owner(chan));
}
enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie)