[media] cx88: drop cx88_free_buffer
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 29 Aug 2014 08:40:47 +0000 (05:40 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 3 Nov 2014 10:28:30 +0000 (08:28 -0200)
Remove this function. This makes all vb2 queues behave the same, which
simplifies comparing the various vb2 queue op implementations.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/pci/cx88/cx88-blackbird.c
drivers/media/pci/cx88/cx88-core.c
drivers/media/pci/cx88/cx88-dvb.c
drivers/media/pci/cx88/cx88-mpeg.c
drivers/media/pci/cx88/cx88-vbi.c
drivers/media/pci/cx88/cx88-video.c
drivers/media/pci/cx88/cx88.h

index 11054cd903af2ace749552874a59e07e2a8a2f9f..b24266ec2b5d18e3d17fa2877249966dafe6bfa3 100644 (file)
@@ -667,7 +667,7 @@ static void buffer_finish(struct vb2_buffer *vb)
        struct cx88_buffer *buf = container_of(vb, struct cx88_buffer, vb);
        struct sg_table *sgt = vb2_dma_sg_plane_desc(vb, 0);
 
-       cx88_free_buffer(vb->vb2_queue, buf);
+       btcx_riscmem_free(dev->pci, &buf->risc);
 
        dma_unmap_sg(&dev->pci->dev, sgt->sgl, sgt->nents, DMA_FROM_DEVICE);
 }
index f027408609707407274225bc84b9a62609dadd3b..902b662be2ff9028e0e82aea3c2933b61252c552 100644 (file)
@@ -198,12 +198,6 @@ int cx88_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc,
        return 0;
 }
 
-void
-cx88_free_buffer(struct vb2_queue *q, struct cx88_buffer *buf)
-{
-       btcx_riscmem_free(to_pci_dev(q->drv_priv), &buf->risc);
-}
-
 /* ------------------------------------------------------------------ */
 /* our SRAM memory layout                                             */
 
@@ -1072,7 +1066,6 @@ EXPORT_SYMBOL(cx88_shutdown);
 
 EXPORT_SYMBOL(cx88_risc_buffer);
 EXPORT_SYMBOL(cx88_risc_databuffer);
-EXPORT_SYMBOL(cx88_free_buffer);
 
 EXPORT_SYMBOL(cx88_sram_channels);
 EXPORT_SYMBOL(cx88_sram_channel_setup);
index d7e5c45022c99d7fdbd89d6d612a43316cdbe6e4..b5b88a64ad7f67cdd4a78645070bf38df0a70a98 100644 (file)
@@ -110,7 +110,7 @@ static void buffer_finish(struct vb2_buffer *vb)
        struct cx88_buffer *buf = container_of(vb, struct cx88_buffer, vb);
        struct sg_table *sgt = vb2_dma_sg_plane_desc(vb, 0);
 
-       cx88_free_buffer(vb->vb2_queue, buf);
+       btcx_riscmem_free(dev->pci, &buf->risc);
 
        dma_unmap_sg(&dev->pci->dev, sgt->sgl, sgt->nents, DMA_FROM_DEVICE);
 }
index 7986ee037b8379a8e877057683e5b8d5af791480..0589dccae3bdeaa49905f1d9f5b14a731d4eec78 100644 (file)
@@ -238,8 +238,12 @@ int cx8802_buf_prepare(struct vb2_queue *q, struct cx8802_dev *dev,
        if (!rc)
                return -EIO;
 
-       cx88_risc_databuffer(dev->pci, &buf->risc, sgt->sgl,
+       rc = cx88_risc_databuffer(dev->pci, &buf->risc, sgt->sgl,
                             dev->ts_packet_size, dev->ts_packet_count, 0);
+       if (rc) {
+               btcx_riscmem_free(dev->pci, &buf->risc);
+               return rc;
+       }
        return 0;
 }
 
index 26a15331cc10352dbce16f3a6a5a7852396e33dd..8f20612c5853df2df47737e7bca21fbb16141279 100644 (file)
@@ -147,7 +147,7 @@ static void buffer_finish(struct vb2_buffer *vb)
        struct cx88_buffer *buf = container_of(vb, struct cx88_buffer, vb);
        struct sg_table *sgt = vb2_dma_sg_plane_desc(vb, 0);
 
-       cx88_free_buffer(vb->vb2_queue, buf);
+       btcx_riscmem_free(dev->pci, &buf->risc);
 
        dma_unmap_sg(&dev->pci->dev, sgt->sgl, sgt->nents, DMA_FROM_DEVICE);
 }
index 9887da52c4550e7dd1075b8e2842cfda5821ca38..c64f8f48850ff1920daab62961cf8286bafaf955 100644 (file)
@@ -506,7 +506,7 @@ static void buffer_finish(struct vb2_buffer *vb)
        struct cx88_buffer *buf = container_of(vb, struct cx88_buffer, vb);
        struct sg_table *sgt = vb2_dma_sg_plane_desc(vb, 0);
 
-       cx88_free_buffer(vb->vb2_queue, buf);
+       btcx_riscmem_free(dev->pci, &buf->risc);
 
        dma_unmap_sg(&dev->pci->dev, sgt->sgl, sgt->nents, DMA_FROM_DEVICE);
 }
index 2dadaa6f0d95660859f1c0a2505952c2ec8f26cd..16965c84090bafd62a24bd9d4da1e55b0e9359ea 100644 (file)
@@ -624,8 +624,6 @@ extern int
 cx88_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc,
                     struct scatterlist *sglist, unsigned int bpl,
                     unsigned int lines, unsigned int lpi);
-extern void
-cx88_free_buffer(struct vb2_queue *q, struct cx88_buffer *buf);
 
 extern void cx88_risc_disasm(struct cx88_core *core,
                             struct btcx_riscmem *risc);