aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx88/cx88-mpeg.c
diff options
context:
space:
mode:
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,
235 return -EINVAL; 235 return -EINVAL;
236 vb2_set_plane_payload(&buf->vb, 0, size); 236 vb2_set_plane_payload(&buf->vb, 0, size);
237 237
238 rc = dma_map_sg(&dev->pci->dev, sgt->sgl, sgt->nents, DMA_FROM_DEVICE);
239 if (!rc)
240 return -EIO;
241
242 rc = cx88_risc_databuffer(dev->pci, risc, sgt->sgl, 238 rc = cx88_risc_databuffer(dev->pci, risc, sgt->sgl,
243 dev->ts_packet_size, dev->ts_packet_count, 0); 239 dev->ts_packet_size, dev->ts_packet_count, 0);
244 if (rc) { 240 if (rc) {
@@ -733,6 +729,11 @@ static int cx8802_probe(struct pci_dev *pci_dev,
733 if (NULL == dev) 729 if (NULL == dev)
734 goto fail_core; 730 goto fail_core;
735 dev->pci = pci_dev; 731 dev->pci = pci_dev;
732 dev->alloc_ctx = vb2_dma_sg_init_ctx(&pci_dev->dev);
733 if (IS_ERR(dev->alloc_ctx)) {
734 err = PTR_ERR(dev->alloc_ctx);
735 goto fail_core;
736 }
736 dev->core = core; 737 dev->core = core;
737 738
738 /* Maintain a reference so cx88-video can query the 8802 device. */ 739 /* Maintain a reference so cx88-video can query the 8802 device. */
@@ -752,6 +753,7 @@ static int cx8802_probe(struct pci_dev *pci_dev,
752 return 0; 753 return 0;
753 754
754 fail_free: 755 fail_free:
756 vb2_dma_sg_cleanup_ctx(dev->alloc_ctx);
755 kfree(dev); 757 kfree(dev);
756 fail_core: 758 fail_core:
757 core->dvbdev = NULL; 759 core->dvbdev = NULL;
@@ -798,6 +800,7 @@ static void cx8802_remove(struct pci_dev *pci_dev)
798 /* common */ 800 /* common */
799 cx8802_fini_common(dev); 801 cx8802_fini_common(dev);
800 cx88_core_put(dev->core,dev->pci); 802 cx88_core_put(dev->core,dev->pci);
803 vb2_dma_sg_cleanup_ctx(dev->alloc_ctx);
801 kfree(dev); 804 kfree(dev);
802} 805}
803 806