[media] media: videobuf2: Restructure vb2_buffer
[sfrench/cifs-2.6.git] / drivers / media / pci / saa7134 / saa7134-vbi.c
index 4d36586ad752bd48159fcdfa6d2480eadb4844db..fb1605e25e528de71dfe6f4d390e40f4a4e91d77 100644 (file)
@@ -83,7 +83,7 @@ static int buffer_activate(struct saa7134_dev *dev,
                           struct saa7134_buf *buf,
                           struct saa7134_buf *next)
 {
-       struct saa7134_dmaqueue *dmaq = buf->vb2.vb2_queue->drv_priv;
+       struct saa7134_dmaqueue *dmaq = buf->vb2.vb2_buf.vb2_queue->drv_priv;
        unsigned long control, base;
 
        vbi_dbg("buffer_activate [%p]\n", buf);
@@ -119,8 +119,9 @@ static int buffer_prepare(struct vb2_buffer *vb2)
 {
        struct saa7134_dmaqueue *dmaq = vb2->vb2_queue->drv_priv;
        struct saa7134_dev *dev = dmaq->dev;
-       struct saa7134_buf *buf = container_of(vb2, struct saa7134_buf, vb2);
-       struct sg_table *dma = vb2_dma_sg_plane_desc(&buf->vb2, 0);
+       struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb2);
+       struct saa7134_buf *buf = container_of(vbuf, struct saa7134_buf, vb2);
+       struct sg_table *dma = vb2_dma_sg_plane_desc(vb2, 0);
        unsigned int size;
 
        if (dma->sgl->offset) {
@@ -161,7 +162,8 @@ static int queue_setup(struct vb2_queue *q, const struct v4l2_format *fmt,
 static int buffer_init(struct vb2_buffer *vb2)
 {
        struct saa7134_dmaqueue *dmaq = vb2->vb2_queue->drv_priv;
-       struct saa7134_buf *buf = container_of(vb2, struct saa7134_buf, vb2);
+       struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb2);
+       struct saa7134_buf *buf = container_of(vbuf, struct saa7134_buf, vb2);
 
        dmaq->curr = NULL;
        buf->activate = buffer_activate;