]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/saa7134/saa7134-vbi.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-2.6-omap-h63xx.git] / drivers / media / video / saa7134 / saa7134-vbi.c
index f4aee0af80e19a942e7d10e28b7321cae709c34c..f0d5ed9c2b0666e1152611f3325f89a6d8914182 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/module.h>
-#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 
@@ -86,7 +85,7 @@ static int buffer_activate(struct saa7134_dev *dev,
        unsigned long control,base;
 
        dprintk("buffer_activate [%p]\n",buf);
-       buf->vb.state = STATE_ACTIVE;
+       buf->vb.state = VIDEOBUF_ACTIVE;
        buf->top_seen = 0;
 
        task_init(dev,buf,TASK_A);
@@ -135,31 +134,33 @@ static int buffer_prepare(struct videobuf_queue *q,
                return -EINVAL;
 
        if (buf->vb.size != size)
-               saa7134_dma_free(dev,buf);
+               saa7134_dma_free(q,buf);
+
+       if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
+               struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
 
-       if (STATE_NEEDS_INIT == buf->vb.state) {
                buf->vb.width  = llength;
                buf->vb.height = lines;
                buf->vb.size   = size;
                buf->pt        = &fh->pt_vbi;
 
-               err = videobuf_iolock(dev->pci,&buf->vb,NULL);
+               err = videobuf_iolock(q,&buf->vb,NULL);
                if (err)
                        goto oops;
                err = saa7134_pgtable_build(dev->pci,buf->pt,
-                                           buf->vb.dma.sglist,
-                                           buf->vb.dma.sglen,
+                                           dma->sglist,
+                                           dma->sglen,
                                            saa7134_buffer_startpage(buf));
                if (err)
                        goto oops;
        }
-       buf->vb.state = STATE_PREPARED;
+       buf->vb.state = VIDEOBUF_PREPARED;
        buf->activate = buffer_activate;
        buf->vb.field = field;
        return 0;
 
  oops:
-       saa7134_dma_free(dev,buf);
+       saa7134_dma_free(q,buf);
        return err;
 }
 
@@ -190,11 +191,9 @@ static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
 
 static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
 {
-       struct saa7134_fh *fh   = q->priv_data;
-       struct saa7134_dev *dev = fh->dev;
        struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb);
 
-       saa7134_dma_free(dev,buf);
+       saa7134_dma_free(q,buf);
 }
 
 struct videobuf_queue_ops saa7134_vbi_qops = {
@@ -241,7 +240,7 @@ void saa7134_irq_vbi_done(struct saa7134_dev *dev, unsigned long status)
                        goto done;
 
                dev->vbi_q.curr->vb.field_count = dev->vbi_fieldcount;
-               saa7134_buffer_finish(dev,&dev->vbi_q,STATE_DONE);
+               saa7134_buffer_finish(dev,&dev->vbi_q,VIDEOBUF_DONE);
        }
        saa7134_buffer_next(dev,&dev->vbi_q);