diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-05-05 17:25:22 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-05-14 01:54:09 -0400 |
commit | 50510993e0452e0941fd03f63aa08256dd9c7fdc (patch) | |
tree | 47a0a0e0f8f2229cabcd1627a5189520e6106af3 /drivers | |
parent | 3f98387efa9333c5765d36e144c47c107d6ba64a (diff) |
V4L/DVB (7856): cx18/: possible cleanups
This patch contains the following possible cleanups:
- cx18-i2c.c should #include "cx18-i2c.h" for getting the prototypes of
it's global functions
- make the following needlessly global functions static:
- cx18-fileops.c:cx18_claim_stream()
- cx18-fileops.c:cx18_release_stream()
- cx18-queue.c:cx18_queue_move()
- remove the following unused functions:
- cx18-driver.c:cx18_waitq()
- cx18-queue.c:cx18_buf_copy_from_user()
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.c | 10 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.h | 3 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-fileops.c | 4 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-fileops.h | 9 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-i2c.c | 1 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-queue.c | 16 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-queue.h | 4 |
7 files changed, 6 insertions, 41 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c index 9453223a3dea..3e9979eff3e0 100644 --- a/drivers/media/video/cx18/cx18-driver.c +++ b/drivers/media/video/cx18/cx18-driver.c | |||
@@ -164,16 +164,6 @@ MODULE_LICENSE("GPL"); | |||
164 | 164 | ||
165 | MODULE_VERSION(CX18_VERSION); | 165 | MODULE_VERSION(CX18_VERSION); |
166 | 166 | ||
167 | int cx18_waitq(wait_queue_head_t *waitq) | ||
168 | { | ||
169 | DEFINE_WAIT(wait); | ||
170 | |||
171 | prepare_to_wait(waitq, &wait, TASK_INTERRUPTIBLE); | ||
172 | schedule(); | ||
173 | finish_wait(waitq, &wait); | ||
174 | return signal_pending(current) ? -EINTR : 0; | ||
175 | } | ||
176 | |||
177 | /* Generic utility functions */ | 167 | /* Generic utility functions */ |
178 | int cx18_msleep_timeout(unsigned int msecs, int intr) | 168 | int cx18_msleep_timeout(unsigned int msecs, int intr) |
179 | { | 169 | { |
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h index 2ee939193bb7..a2a6c58d12fe 100644 --- a/drivers/media/video/cx18/cx18-driver.h +++ b/drivers/media/video/cx18/cx18-driver.h | |||
@@ -444,9 +444,6 @@ extern spinlock_t cx18_cards_lock; | |||
444 | /* Return non-zero if a signal is pending */ | 444 | /* Return non-zero if a signal is pending */ |
445 | int cx18_msleep_timeout(unsigned int msecs, int intr); | 445 | int cx18_msleep_timeout(unsigned int msecs, int intr); |
446 | 446 | ||
447 | /* Wait on queue, returns -EINTR if interrupted */ | ||
448 | int cx18_waitq(wait_queue_head_t *waitq); | ||
449 | |||
450 | /* Read Hauppauge eeprom */ | 447 | /* Read Hauppauge eeprom */ |
451 | struct tveeprom; /* forward reference */ | 448 | struct tveeprom; /* forward reference */ |
452 | void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv); | 449 | void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv); |
diff --git a/drivers/media/video/cx18/cx18-fileops.c b/drivers/media/video/cx18/cx18-fileops.c index 69303065a294..91eff6e671a7 100644 --- a/drivers/media/video/cx18/cx18-fileops.c +++ b/drivers/media/video/cx18/cx18-fileops.c | |||
@@ -39,7 +39,7 @@ | |||
39 | associated VBI streams are also automatically claimed. | 39 | associated VBI streams are also automatically claimed. |
40 | Possible error returns: -EBUSY if someone else has claimed | 40 | Possible error returns: -EBUSY if someone else has claimed |
41 | the stream or 0 on success. */ | 41 | the stream or 0 on success. */ |
42 | int cx18_claim_stream(struct cx18_open_id *id, int type) | 42 | static int cx18_claim_stream(struct cx18_open_id *id, int type) |
43 | { | 43 | { |
44 | struct cx18 *cx = id->cx; | 44 | struct cx18 *cx = id->cx; |
45 | struct cx18_stream *s = &cx->streams[type]; | 45 | struct cx18_stream *s = &cx->streams[type]; |
@@ -87,7 +87,7 @@ int cx18_claim_stream(struct cx18_open_id *id, int type) | |||
87 | 87 | ||
88 | /* This function releases a previously claimed stream. It will take into | 88 | /* This function releases a previously claimed stream. It will take into |
89 | account associated VBI streams. */ | 89 | account associated VBI streams. */ |
90 | void cx18_release_stream(struct cx18_stream *s) | 90 | static void cx18_release_stream(struct cx18_stream *s) |
91 | { | 91 | { |
92 | struct cx18 *cx = s->cx; | 92 | struct cx18 *cx = s->cx; |
93 | struct cx18_stream *s_vbi; | 93 | struct cx18_stream *s_vbi; |
diff --git a/drivers/media/video/cx18/cx18-fileops.h b/drivers/media/video/cx18/cx18-fileops.h index 16cdafbd24c5..46da0282fc7d 100644 --- a/drivers/media/video/cx18/cx18-fileops.h +++ b/drivers/media/video/cx18/cx18-fileops.h | |||
@@ -34,12 +34,3 @@ void cx18_stop_capture(struct cx18_open_id *id, int gop_end); | |||
34 | void cx18_mute(struct cx18 *cx); | 34 | void cx18_mute(struct cx18 *cx); |
35 | void cx18_unmute(struct cx18 *cx); | 35 | void cx18_unmute(struct cx18 *cx); |
36 | 36 | ||
37 | /* Utilities */ | ||
38 | |||
39 | /* Try to claim a stream for the filehandle. Return 0 on success, | ||
40 | -EBUSY if stream already claimed. Once a stream is claimed, it | ||
41 | remains claimed until the associated filehandle is closed. */ | ||
42 | int cx18_claim_stream(struct cx18_open_id *id, int type); | ||
43 | |||
44 | /* Release a previously claimed stream. */ | ||
45 | void cx18_release_stream(struct cx18_stream *s); | ||
diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c index 18c88d1e4833..4f08a4058d1a 100644 --- a/drivers/media/video/cx18/cx18-i2c.c +++ b/drivers/media/video/cx18/cx18-i2c.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "cx18-cards.h" | 25 | #include "cx18-cards.h" |
26 | #include "cx18-gpio.h" | 26 | #include "cx18-gpio.h" |
27 | #include "cx18-av-core.h" | 27 | #include "cx18-av-core.h" |
28 | #include "cx18-i2c.h" | ||
28 | 29 | ||
29 | #include <media/ir-kbd-i2c.h> | 30 | #include <media/ir-kbd-i2c.h> |
30 | 31 | ||
diff --git a/drivers/media/video/cx18/cx18-queue.c b/drivers/media/video/cx18/cx18-queue.c index 4ef6996b2048..6990b77c6200 100644 --- a/drivers/media/video/cx18/cx18-queue.c +++ b/drivers/media/video/cx18/cx18-queue.c | |||
@@ -26,17 +26,6 @@ | |||
26 | #include "cx18-queue.h" | 26 | #include "cx18-queue.h" |
27 | #include "cx18-scb.h" | 27 | #include "cx18-scb.h" |
28 | 28 | ||
29 | int cx18_buf_copy_from_user(struct cx18_stream *s, struct cx18_buffer *buf, | ||
30 | const char __user *src, int copybytes) | ||
31 | { | ||
32 | if (s->buf_size - buf->bytesused < copybytes) | ||
33 | copybytes = s->buf_size - buf->bytesused; | ||
34 | if (copy_from_user(buf->buf + buf->bytesused, src, copybytes)) | ||
35 | return -EFAULT; | ||
36 | buf->bytesused += copybytes; | ||
37 | return copybytes; | ||
38 | } | ||
39 | |||
40 | void cx18_buf_swap(struct cx18_buffer *buf) | 29 | void cx18_buf_swap(struct cx18_buffer *buf) |
41 | { | 30 | { |
42 | int i; | 31 | int i; |
@@ -159,8 +148,9 @@ static void cx18_queue_move_buf(struct cx18_stream *s, struct cx18_queue *from, | |||
159 | -ENOMEM is returned if the buffers could not be obtained, 0 if all | 148 | -ENOMEM is returned if the buffers could not be obtained, 0 if all |
160 | buffers where obtained from the 'from' list and if non-zero then | 149 | buffers where obtained from the 'from' list and if non-zero then |
161 | the number of stolen buffers is returned. */ | 150 | the number of stolen buffers is returned. */ |
162 | int cx18_queue_move(struct cx18_stream *s, struct cx18_queue *from, | 151 | static int cx18_queue_move(struct cx18_stream *s, struct cx18_queue *from, |
163 | struct cx18_queue *steal, struct cx18_queue *to, int needed_bytes) | 152 | struct cx18_queue *steal, struct cx18_queue *to, |
153 | int needed_bytes) | ||
164 | { | 154 | { |
165 | unsigned long flags; | 155 | unsigned long flags; |
166 | int rc = 0; | 156 | int rc = 0; |
diff --git a/drivers/media/video/cx18/cx18-queue.h b/drivers/media/video/cx18/cx18-queue.h index f86c8a6fa6e7..91423b9863a4 100644 --- a/drivers/media/video/cx18/cx18-queue.h +++ b/drivers/media/video/cx18/cx18-queue.h | |||
@@ -39,8 +39,6 @@ static inline void cx18_buf_sync_for_device(struct cx18_stream *s, | |||
39 | s->buf_size, s->dma); | 39 | s->buf_size, s->dma); |
40 | } | 40 | } |
41 | 41 | ||
42 | int cx18_buf_copy_from_user(struct cx18_stream *s, struct cx18_buffer *buf, | ||
43 | const char __user *src, int copybytes); | ||
44 | void cx18_buf_swap(struct cx18_buffer *buf); | 42 | void cx18_buf_swap(struct cx18_buffer *buf); |
45 | 43 | ||
46 | /* cx18_queue utility functions */ | 44 | /* cx18_queue utility functions */ |
@@ -48,8 +46,6 @@ void cx18_queue_init(struct cx18_queue *q); | |||
48 | void cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf, | 46 | void cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf, |
49 | struct cx18_queue *q); | 47 | struct cx18_queue *q); |
50 | struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q); | 48 | struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q); |
51 | int cx18_queue_move(struct cx18_stream *s, struct cx18_queue *from, | ||
52 | struct cx18_queue *steal, struct cx18_queue *to, int needed_bytes); | ||
53 | struct cx18_buffer *cx18_queue_find_buf(struct cx18_stream *s, u32 id, | 49 | struct cx18_buffer *cx18_queue_find_buf(struct cx18_stream *s, u32 id, |
54 | u32 bytesused); | 50 | u32 bytesused); |
55 | void cx18_flush_queues(struct cx18_stream *s); | 51 | void cx18_flush_queues(struct cx18_stream *s); |