diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-08 11:20:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 23:03:14 -0400 |
commit | d4cae5a50021271b9ef4e5e39e71e177d12fa8cb (patch) | |
tree | 75f3def69e6b35fc02e46af5661bb45aa006ba9d /drivers/media/video/videobuf-core.c | |
parent | d5f1b01644b6fd5e9eb480a4762cd6b569cb1246 (diff) |
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 <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/videobuf-core.c')
-rw-r--r-- | drivers/media/video/videobuf-core.c | 23 |
1 files changed, 14 insertions, 9 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 | ||