]> 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)
commit53a27c2733c53a5e73b715517090f4262a88441d
tree393b6621b115e7cc07ff47e75ab897f929902654
parent0d6194b08cb67bef10c1121142a21fd8e2c9dafe
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