summaryrefslogtreecommitdiffstats
path: root/drivers/dma/virt-dma.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-05-11 00:39:27 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-07-01 15:15:22 +0200
commitfe045874aaf4480386c65baf1acae82af4c5e21f (patch)
tree00bd605046eb02e925b710bc625b9f9b70fa3c94 /drivers/dma/virt-dma.c
parentdmaengine: split out virtual channel DMA support from sa11x0 driver (diff)
downloadlinux-fe045874aaf4480386c65baf1acae82af4c5e21f.tar.xz
linux-fe045874aaf4480386c65baf1acae82af4c5e21f.zip
dmaengine: virt-dma: vchan_find_desc()
Add a function to find a descriptor within the depths of the virtualized DMA channel support. Needed for tx_status functionality. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/dma/virt-dma.c')
-rw-r--r--drivers/dma/virt-dma.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/dma/virt-dma.c b/drivers/dma/virt-dma.c
index bd85b052b481..a8054fc40cef 100644
--- a/drivers/dma/virt-dma.c
+++ b/drivers/dma/virt-dma.c
@@ -39,6 +39,19 @@ dma_cookie_t vchan_tx_submit(struct dma_async_tx_descriptor *tx)
}
EXPORT_SYMBOL_GPL(vchan_tx_submit);
+struct virt_dma_desc *vchan_find_desc(struct virt_dma_chan *vc,
+ dma_cookie_t cookie)
+{
+ struct virt_dma_desc *vd;
+
+ list_for_each_entry(vd, &vc->desc_issued, node)
+ if (vd->tx.cookie == cookie)
+ return vd;
+
+ return NULL;
+}
+EXPORT_SYMBOL_GPL(vchan_find_desc);
+
/*
* This tasklet handles the completion of a DMA descriptor by
* calling its callback and freeing it.