Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d4cae5a50021271b9ef4e5e39e71e177d12fa8cb
Commit:     d4cae5a50021271b9ef4e5e39e71e177d12fa8cb
Parent:     d5f1b01644b6fd5e9eb480a4762cd6b569cb1246
Author:     Mauro Carvalho Chehab <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 8 12:20:02 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 00:03:14 2007 -0300

    V4L/DVB (6292): videobuf_core init always require callback implementation
    
    In the past, videobuf_queue_init were used to initialize PCI DMA 
videobuffers.
    This patch renames it, to avoid confusion with the previous kernel API, 
doing:
        s/videobuf_queue_init/void videobuf_queue_core_init/
    
    Also, the operations is now part of the function parameter. The function 
will
    also add a test if this is defined, otherwise producing BUG.
    
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/videobuf-core.c    |   23 ++++++++++++++---------
 drivers/media/video/videobuf-dma-sg.c  |    4 ++--
 drivers/media/video/videobuf-vmalloc.c |    4 ++--
 include/media/videobuf-core.h          |    5 +++--
 4 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/drivers/media/video/videobuf-core.c 
b/drivers/media/video/videobuf-core.c
index aa402ab..f5c5ea8 100644
--- a/drivers/media/video/videobuf-core.c
+++ b/drivers/media/video/videobuf-core.c
@@ -108,23 +108,25 @@ int videobuf_iolock(struct videobuf_queue* q, struct 
videobuf_buffer *vb,
 /* --------------------------------------------------------------------- */
 
 
-void videobuf_queue_init(struct videobuf_queue* q,
+void videobuf_queue_core_init(struct videobuf_queue* q,
                         struct videobuf_queue_ops *ops,
                         void *dev,
                         spinlock_t *irqlock,
                         enum v4l2_buf_type type,
                         enum v4l2_field field,
                         unsigned int msize,
-                        void *priv)
+                        void *priv,
+                        struct videobuf_qtype_ops *int_ops)
 {
        memset(q,0,sizeof(*q));
-       q->irqlock = irqlock;
-       q->dev     = dev;
-       q->type    = type;
-       q->field   = field;
-       q->msize   = msize;
-       q->ops     = ops;
+       q->irqlock   = irqlock;
+       q->dev       = dev;
+       q->type      = type;
+       q->field     = field;
+       q->msize     = msize;
+       q->ops       = ops;
        q->priv_data = priv;
+       q->int_ops   = int_ops;
 
        /* All buffer operations are mandatory */
        BUG_ON (!q->ops->buf_setup);
@@ -132,6 +134,9 @@ void videobuf_queue_init(struct videobuf_queue* q,
        BUG_ON (!q->ops->buf_queue);
        BUG_ON (!q->ops->buf_release);
 
+       /* Having implementations for abstract methods are mandatory */
+       BUG_ON (!q->int_ops);
+
        mutex_init(&q->lock);
        INIT_LIST_HEAD(&q->stream);
 }
@@ -966,7 +971,7 @@ EXPORT_SYMBOL_GPL(videobuf_iolock);
 
 EXPORT_SYMBOL_GPL(videobuf_alloc);
 
-EXPORT_SYMBOL_GPL(videobuf_queue_init);
+EXPORT_SYMBOL_GPL(videobuf_queue_core_init);
 EXPORT_SYMBOL_GPL(videobuf_queue_cancel);
 EXPORT_SYMBOL_GPL(videobuf_queue_is_busy);
 
diff --git a/drivers/media/video/videobuf-dma-sg.c 
b/drivers/media/video/videobuf-dma-sg.c
index a38efe1..8bb7fdd 100644
--- a/drivers/media/video/videobuf-dma-sg.c
+++ b/drivers/media/video/videobuf-dma-sg.c
@@ -695,8 +695,8 @@ void videobuf_queue_pci_init(struct videobuf_queue* q,
                         unsigned int msize,
                         void *priv)
 {
-       videobuf_queue_init(q, ops, dev, irqlock, type, field, msize, priv);
-       q->int_ops=&pci_ops;
+       videobuf_queue_core_init(q, ops, dev, irqlock, type, field, msize,
+                                priv, &pci_ops);
 }
 
 /* --------------------------------------------------------------------- */
diff --git a/drivers/media/video/videobuf-vmalloc.c 
b/drivers/media/video/videobuf-vmalloc.c
index c9d6ae0..2e3689a 100644
--- a/drivers/media/video/videobuf-vmalloc.c
+++ b/drivers/media/video/videobuf-vmalloc.c
@@ -333,8 +333,8 @@ void videobuf_queue_vmalloc_init(struct videobuf_queue* q,
                         unsigned int msize,
                         void *priv)
 {
-       videobuf_queue_init(q, ops, dev, irqlock, type, field, msize, priv);
-       q->int_ops=&qops;
+       videobuf_queue_core_init(q, ops, dev, irqlock, type, field, msize,
+                                priv, &qops);
 }
 
 EXPORT_SYMBOL_GPL(videobuf_queue_vmalloc_init);
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index 9bae5a2..9fa09fb 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -181,14 +181,15 @@ int videobuf_iolock(struct videobuf_queue* q, struct 
videobuf_buffer *vb,
 
 void *videobuf_alloc(struct videobuf_queue* q);
 
-void videobuf_queue_init(struct videobuf_queue *q,
+void videobuf_queue_core_init(struct videobuf_queue *q,
                         struct videobuf_queue_ops *ops,
                         void *dev,
                         spinlock_t *irqlock,
                         enum v4l2_buf_type type,
                         enum v4l2_field field,
                         unsigned int msize,
-                        void *priv);
+                        void *priv,
+                        struct videobuf_qtype_ops *int_ops);
 int  videobuf_queue_is_busy(struct videobuf_queue *q);
 void videobuf_queue_cancel(struct videobuf_queue *q);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to