]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: Add reference counting to dma_device struct
authorLogan Gunthorpe <logang@deltatee.com>
Mon, 16 Dec 2019 19:01:19 +0000 (12:01 -0700)
committerVinod Koul <vkoul@kernel.org>
Tue, 24 Dec 2019 04:48:32 +0000 (10:18 +0530)
commitc43177c236574c3944349242bfe9fce9ccaf3f6c
tree393b6621b115e7cc07ff47e75ab897f929902654
parent14d3d6f054f373c02b457bd5e52b9edadfbfebba
dmaengine: Add reference counting to dma_device struct

Adding a reference count helps drivers to properly implement the unbind
while in use case.

References are taken and put every time a channel is allocated or freed.

Once the final reference is put, the device is removed from the
dma_device_list and a release callback function is called to signal
the driver to free the memory.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Link: https://lore.kernel.org/r/20191216190120.21374-5-logang@deltatee.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dmaengine.c
include/linux/dmaengine.h