aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorPawel Osciak <p.osciak@samsung.com>2010-03-17 03:01:04 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-17 23:50:25 -0400
commit7a02264ca9ec5409e22b9d41f32b431d08eadbce (patch)
tree4c7cd63a863c10f0fbe8d8ec7927e203e9d7577f /include/media
parent85e092190b5f7dfe9b78556440472c5590a32b4e (diff)
V4L/DVB: v4l: videobuf: code cleanup
Make videobuf pass checkpatch; minor code cleanups. Signed-off-by: Pawel Osciak <p.osciak@samsung.com> Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/videobuf-core.h10
-rw-r--r--include/media/videobuf-dma-sg.h27
-rw-r--r--include/media/videobuf-vmalloc.h12
3 files changed, 26 insertions, 23 deletions
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index 316fdccdcaa0..b1f7bf423fd3 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -129,14 +129,14 @@ struct videobuf_qtype_ops {
129 129
130 void *(*alloc) (size_t size); 130 void *(*alloc) (size_t size);
131 void *(*vmalloc) (struct videobuf_buffer *buf); 131 void *(*vmalloc) (struct videobuf_buffer *buf);
132 int (*iolock) (struct videobuf_queue* q, 132 int (*iolock) (struct videobuf_queue *q,
133 struct videobuf_buffer *vb, 133 struct videobuf_buffer *vb,
134 struct v4l2_framebuffer *fbuf); 134 struct v4l2_framebuffer *fbuf);
135 int (*mmap) (struct videobuf_queue *q, 135 int (*mmap) (struct videobuf_queue *q,
136 unsigned int *count, 136 unsigned int *count,
137 unsigned int *size, 137 unsigned int *size,
138 enum v4l2_memory memory); 138 enum v4l2_memory memory);
139 int (*sync) (struct videobuf_queue* q, 139 int (*sync) (struct videobuf_queue *q,
140 struct videobuf_buffer *buf); 140 struct videobuf_buffer *buf);
141 int (*video_copy_to_user)(struct videobuf_queue *q, 141 int (*video_copy_to_user)(struct videobuf_queue *q,
142 char __user *data, 142 char __user *data,
@@ -185,14 +185,14 @@ struct videobuf_queue {
185}; 185};
186 186
187int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); 187int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr);
188int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb, 188int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb,
189 struct v4l2_framebuffer *fbuf); 189 struct v4l2_framebuffer *fbuf);
190 190
191void *videobuf_alloc(struct videobuf_queue* q); 191void *videobuf_alloc(struct videobuf_queue* q);
192 192
193/* Used on videobuf-dvb */ 193/* Used on videobuf-dvb */
194void *videobuf_queue_to_vmalloc (struct videobuf_queue* q, 194void *videobuf_queue_to_vmalloc(struct videobuf_queue *q,
195 struct videobuf_buffer *buf); 195 struct videobuf_buffer *buf);
196 196
197void videobuf_queue_core_init(struct videobuf_queue *q, 197void videobuf_queue_core_init(struct videobuf_queue *q,
198 const struct videobuf_queue_ops *ops, 198 const struct videobuf_queue_ops *ops,
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h
index 53e72f787175..dbfd8cf7b7cb 100644
--- a/include/media/videobuf-dma-sg.h
+++ b/include/media/videobuf-dma-sg.h
@@ -17,6 +17,8 @@
17 * it under the terms of the GNU General Public License as published by 17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 18 * the Free Software Foundation; either version 2
19 */ 19 */
20#ifndef _VIDEOBUF_DMA_SG_H
21#define _VIDEOBUF_DMA_SG_H
20 22
21#include <media/videobuf-core.h> 23#include <media/videobuf-core.h>
22 24
@@ -27,14 +29,14 @@
27 * block (NULL on errors). Memory for the scatterlist is allocated 29 * block (NULL on errors). Memory for the scatterlist is allocated
28 * using kmalloc. The caller must free the memory. 30 * using kmalloc. The caller must free the memory.
29 */ 31 */
30struct scatterlist* videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages); 32struct scatterlist *videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages);
31 33
32/* 34/*
33 * Return a scatterlist for a an array of userpages (NULL on errors). 35 * Return a scatterlist for a an array of userpages (NULL on errors).
34 * Memory for the scatterlist is allocated using kmalloc. The caller 36 * Memory for the scatterlist is allocated using kmalloc. The caller
35 * must free the memory. 37 * must free the memory.
36 */ 38 */
37struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages, 39struct scatterlist *videobuf_pages_to_sg(struct page **pages, int nr_pages,
38 int offset); 40 int offset);
39 41
40/* --------------------------------------------------------------------- */ 42/* --------------------------------------------------------------------- */
@@ -78,8 +80,7 @@ struct videobuf_dmabuf {
78 int direction; 80 int direction;
79}; 81};
80 82
81struct videobuf_dma_sg_memory 83struct videobuf_dma_sg_memory {
82{
83 u32 magic; 84 u32 magic;
84 85
85 /* for mmap'ed buffers */ 86 /* for mmap'ed buffers */
@@ -95,14 +96,14 @@ int videobuf_dma_init_overlay(struct videobuf_dmabuf *dma, int direction,
95 dma_addr_t addr, int nr_pages); 96 dma_addr_t addr, int nr_pages);
96int videobuf_dma_free(struct videobuf_dmabuf *dma); 97int videobuf_dma_free(struct videobuf_dmabuf *dma);
97 98
98int videobuf_dma_map(struct videobuf_queue* q,struct videobuf_dmabuf *dma); 99int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma);
99int videobuf_dma_sync(struct videobuf_queue* q,struct videobuf_dmabuf *dma); 100int videobuf_dma_sync(struct videobuf_queue *q, struct videobuf_dmabuf *dma);
100int videobuf_dma_unmap(struct videobuf_queue* q,struct videobuf_dmabuf *dma); 101int videobuf_dma_unmap(struct videobuf_queue *q, struct videobuf_dmabuf *dma);
101struct videobuf_dmabuf *videobuf_to_dma (struct videobuf_buffer *buf); 102struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf);
102 103
103void *videobuf_sg_alloc(size_t size); 104void *videobuf_sg_alloc(size_t size);
104 105
105void videobuf_queue_sg_init(struct videobuf_queue* q, 106void videobuf_queue_sg_init(struct videobuf_queue *q,
106 const struct videobuf_queue_ops *ops, 107 const struct videobuf_queue_ops *ops,
107 struct device *dev, 108 struct device *dev,
108 spinlock_t *irqlock, 109 spinlock_t *irqlock,
@@ -111,9 +112,11 @@ void videobuf_queue_sg_init(struct videobuf_queue* q,
111 unsigned int msize, 112 unsigned int msize,
112 void *priv); 113 void *priv);
113 114
114 /*FIXME: these variants are used only on *-alsa code, where videobuf is 115/*FIXME: these variants are used only on *-alsa code, where videobuf is
115 * used without queue 116 * used without queue
116 */ 117 */
117int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma); 118int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma);
118int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma); 119int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma);
119 120
121#endif /* _VIDEOBUF_DMA_SG_H */
122
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h
index 4b419a257a7d..851eb1a2ff2a 100644
--- a/include/media/videobuf-vmalloc.h
+++ b/include/media/videobuf-vmalloc.h
@@ -19,17 +19,17 @@
19 19
20/* --------------------------------------------------------------------- */ 20/* --------------------------------------------------------------------- */
21 21
22struct videobuf_vmalloc_memory 22struct videobuf_vmalloc_memory {
23{
24 u32 magic; 23 u32 magic;
25 24
26 void *vmalloc; 25 void *vmalloc;
27 26
28 /* remap_vmalloc_range seems to need to run after mmap() on some cases */ 27 /* remap_vmalloc_range seems to need to run
28 * after mmap() on some cases */
29 struct vm_area_struct *vma; 29 struct vm_area_struct *vma;
30}; 30};
31 31
32void videobuf_queue_vmalloc_init(struct videobuf_queue* q, 32void videobuf_queue_vmalloc_init(struct videobuf_queue *q,
33 const struct videobuf_queue_ops *ops, 33 const struct videobuf_queue_ops *ops,
34 struct device *dev, 34 struct device *dev,
35 spinlock_t *irqlock, 35 spinlock_t *irqlock,
@@ -38,8 +38,8 @@ void videobuf_queue_vmalloc_init(struct videobuf_queue* q,
38 unsigned int msize, 38 unsigned int msize,
39 void *priv); 39 void *priv);
40 40
41void *videobuf_to_vmalloc (struct videobuf_buffer *buf); 41void *videobuf_to_vmalloc(struct videobuf_buffer *buf);
42 42
43void videobuf_vmalloc_free (struct videobuf_buffer *buf); 43void videobuf_vmalloc_free(struct videobuf_buffer *buf);
44 44
45#endif 45#endif