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);
}
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 */
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);
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);
}
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;
}
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);
}
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);
}
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);