These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / media / pci / saa7134 / saa7134-vbi.c
index 5306e54..6271b0e 100644 (file)
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include "saa7134.h"
+#include "saa7134-reg.h"
+
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 
-#include "saa7134-reg.h"
-#include "saa7134.h"
-
 /* ------------------------------------------------------------------ */
 
 static unsigned int vbi_debug;
@@ -38,8 +38,10 @@ static unsigned int vbibufs = 4;
 module_param(vbibufs, int, 0444);
 MODULE_PARM_DESC(vbibufs,"number of vbi buffers, range 2-32");
 
-#define dprintk(fmt, arg...)   if (vbi_debug) \
-       printk(KERN_DEBUG "%s/vbi: " fmt, dev->name , ## arg)
+#define vbi_dbg(fmt, arg...) do { \
+       if (vbi_debug) \
+               printk(KERN_DEBUG pr_fmt("vbi: " fmt), ## arg); \
+       } while (0)
 
 /* ------------------------------------------------------------------ */
 
@@ -81,10 +83,10 @@ 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;
 
-       dprintk("buffer_activate [%p]\n", buf);
+       vbi_dbg("buffer_activate [%p]\n", buf);
        buf->top_seen = 0;
 
        task_init(dev, buf, TASK_A);
@@ -117,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) {
@@ -135,7 +138,7 @@ static int buffer_prepare(struct vb2_buffer *vb2)
                                    saa7134_buffer_startpage(buf));
 }
 
-static int queue_setup(struct vb2_queue *q, const struct v4l2_format *fmt,
+static int queue_setup(struct vb2_queue *q, const void *parg,
                           unsigned int *nbuffers, unsigned int *nplanes,
                           unsigned int sizes[], void *alloc_ctxs[])
 {
@@ -159,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;