diff options
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/videobuf-core.c | 23 | ||||
-rw-r--r-- | drivers/media/video/videobuf-dma-sg.c | 4 | ||||
-rw-r--r-- | drivers/media/video/videobuf-vmalloc.c | 4 |
3 files changed, 18 insertions, 13 deletions
diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c index aa402abc4b0c..f5c5ea8b6b08 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, | |||
108 | /* --------------------------------------------------------------------- */ | 108 | /* --------------------------------------------------------------------- */ |
109 | 109 | ||
110 | 110 | ||
111 | void videobuf_queue_init(struct videobuf_queue* q, | 111 | void videobuf_queue_core_init(struct videobuf_queue* q, |
112 | struct videobuf_queue_ops *ops, | 112 | struct videobuf_queue_ops *ops, |
113 | void *dev, | 113 | void *dev, |
114 | spinlock_t *irqlock, | 114 | spinlock_t *irqlock, |
115 | enum v4l2_buf_type type, | 115 | enum v4l2_buf_type type, |
116 | enum v4l2_field field, | 116 | enum v4l2_field field, |
117 | unsigned int msize, | 117 | unsigned int msize, |
118 | void *priv) | 118 | void *priv, |
119 | struct videobuf_qtype_ops *int_ops) | ||
119 | { | 120 | { |
120 | memset(q,0,sizeof(*q)); | 121 | memset(q,0,sizeof(*q)); |
121 | q->irqlock = irqlock; | 122 | q->irqlock = irqlock; |
122 | q->dev = dev; | 123 | q->dev = dev; |
123 | q->type = type; | 124 | q->type = type; |
124 | q->field = field; | 125 | q->field = field; |
125 | q->msize = msize; | 126 | q->msize = msize; |
126 | q->ops = ops; | 127 | q->ops = ops; |
127 | q->priv_data = priv; | 128 | q->priv_data = priv; |
129 | q->int_ops = int_ops; | ||
128 | 130 | ||
129 | /* All buffer operations are mandatory */ | 131 | /* All buffer operations are mandatory */ |
130 | BUG_ON (!q->ops->buf_setup); | 132 | BUG_ON (!q->ops->buf_setup); |
@@ -132,6 +134,9 @@ void videobuf_queue_init(struct videobuf_queue* q, | |||
132 | BUG_ON (!q->ops->buf_queue); | 134 | BUG_ON (!q->ops->buf_queue); |
133 | BUG_ON (!q->ops->buf_release); | 135 | BUG_ON (!q->ops->buf_release); |
134 | 136 | ||
137 | /* Having implementations for abstract methods are mandatory */ | ||
138 | BUG_ON (!q->int_ops); | ||
139 | |||
135 | mutex_init(&q->lock); | 140 | mutex_init(&q->lock); |
136 | INIT_LIST_HEAD(&q->stream); | 141 | INIT_LIST_HEAD(&q->stream); |
137 | } | 142 | } |
@@ -966,7 +971,7 @@ EXPORT_SYMBOL_GPL(videobuf_iolock); | |||
966 | 971 | ||
967 | EXPORT_SYMBOL_GPL(videobuf_alloc); | 972 | EXPORT_SYMBOL_GPL(videobuf_alloc); |
968 | 973 | ||
969 | EXPORT_SYMBOL_GPL(videobuf_queue_init); | 974 | EXPORT_SYMBOL_GPL(videobuf_queue_core_init); |
970 | EXPORT_SYMBOL_GPL(videobuf_queue_cancel); | 975 | EXPORT_SYMBOL_GPL(videobuf_queue_cancel); |
971 | EXPORT_SYMBOL_GPL(videobuf_queue_is_busy); | 976 | EXPORT_SYMBOL_GPL(videobuf_queue_is_busy); |
972 | 977 | ||
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c index a38efe10feb4..8bb7fdd306d6 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, | |||
695 | unsigned int msize, | 695 | unsigned int msize, |
696 | void *priv) | 696 | void *priv) |
697 | { | 697 | { |
698 | videobuf_queue_init(q, ops, dev, irqlock, type, field, msize, priv); | 698 | videobuf_queue_core_init(q, ops, dev, irqlock, type, field, msize, |
699 | q->int_ops=&pci_ops; | 699 | priv, &pci_ops); |
700 | } | 700 | } |
701 | 701 | ||
702 | /* --------------------------------------------------------------------- */ | 702 | /* --------------------------------------------------------------------- */ |
diff --git a/drivers/media/video/videobuf-vmalloc.c b/drivers/media/video/videobuf-vmalloc.c index c9d6ae0d3b49..2e3689a12a28 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, | |||
333 | unsigned int msize, | 333 | unsigned int msize, |
334 | void *priv) | 334 | void *priv) |
335 | { | 335 | { |
336 | videobuf_queue_init(q, ops, dev, irqlock, type, field, msize, priv); | 336 | videobuf_queue_core_init(q, ops, dev, irqlock, type, field, msize, |
337 | q->int_ops=&qops; | 337 | priv, &qops); |
338 | } | 338 | } |
339 | 339 | ||
340 | EXPORT_SYMBOL_GPL(videobuf_queue_vmalloc_init); | 340 | EXPORT_SYMBOL_GPL(videobuf_queue_vmalloc_init); |