Commit 83c77940 authored by Vinod Koul's avatar Vinod Koul

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: default avatarLogan Gunthorpe <logang@deltatee.com>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent bf453a0a
...@@ -427,15 +427,15 @@ static void dma_chan_put(struct dma_chan *chan) ...@@ -427,15 +427,15 @@ static void dma_chan_put(struct dma_chan *chan)
chan->device->device_free_chan_resources(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 the channel is used via a DMA request router, free the mapping */
if (chan->router && chan->router->route_free) { if (chan->router && chan->router->route_free) {
chan->router->route_free(chan->router->dev, chan->route_data); chan->router->route_free(chan->router->dev, chan->route_data);
chan->router = NULL; chan->router = NULL;
chan->route_data = 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) enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie)
......
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