summaryrefslogtreecommitdiff
path: root/drivers/media/pci/cx88/cx88-mpeg.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-12-08 13:23:49 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-12-16 23:21:40 -0200
commit165d00439fa9e9da7f263dc844cbd524cf624074 (patch)
tree341fb85627d841edcc93175f12c3247ab40b444a /drivers/media/pci/cx88/cx88-mpeg.c
parent454a4e728dd56c8515b80381c14168099279e7fc (diff)
[media] cx88: add missing alloc_ctx support
The cx88 vb2 conversion and the vb2 dma_sg improvements were developed separately and were merged separately. Unfortunately, the patch updating drivers to the dma_sg improvements didn't take the updated cx88 driver into account. Basically two ships passing in the night, unaware of one another even though both ships have the same owner, i.e. me :-) Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reported-by: Chris Lee <updatelee@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci/cx88/cx88-mpeg.c')
-rw-r--r--drivers/media/pci/cx88/cx88-mpeg.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/media/pci/cx88/cx88-mpeg.c b/drivers/media/pci/cx88/cx88-mpeg.c
index f181a3a10389..1c1f69e6b0b9 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -235,10 +235,6 @@ int cx8802_buf_prepare(struct vb2_queue *q, struct cx8802_dev *dev,
return -EINVAL;
vb2_set_plane_payload(&buf->vb, 0, size);
- rc = dma_map_sg(&dev->pci->dev, sgt->sgl, sgt->nents, DMA_FROM_DEVICE);
- if (!rc)
- return -EIO;
-
rc = cx88_risc_databuffer(dev->pci, risc, sgt->sgl,
dev->ts_packet_size, dev->ts_packet_count, 0);
if (rc) {
@@ -733,6 +729,11 @@ static int cx8802_probe(struct pci_dev *pci_dev,
if (NULL == dev)
goto fail_core;
dev->pci = pci_dev;
+ dev->alloc_ctx = vb2_dma_sg_init_ctx(&pci_dev->dev);
+ if (IS_ERR(dev->alloc_ctx)) {
+ err = PTR_ERR(dev->alloc_ctx);
+ goto fail_core;
+ }
dev->core = core;
/* Maintain a reference so cx88-video can query the 8802 device. */
@@ -752,6 +753,7 @@ static int cx8802_probe(struct pci_dev *pci_dev,
return 0;
fail_free:
+ vb2_dma_sg_cleanup_ctx(dev->alloc_ctx);
kfree(dev);
fail_core:
core->dvbdev = NULL;
@@ -798,6 +800,7 @@ static void cx8802_remove(struct pci_dev *pci_dev)
/* common */
cx8802_fini_common(dev);
cx88_core_put(dev->core,dev->pci);
+ vb2_dma_sg_cleanup_ctx(dev->alloc_ctx);
kfree(dev);
}