aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-fileops.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2008-08-22 20:03:11 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:36:53 -0400
commitb04bce476c57ac844962462ee4c813c44fa942cf (patch)
treefb08a484414e6e486fd31c59c8533c46fd4b1341 /drivers/media/video/cx18/cx18-fileops.c
parent59ba2b002265f2e862aa7f0df3f13c09ea99c4da (diff)
V4L/DVB (8772): cx18: Convert cx18_queue buffers member to atomic_t
cx18: Convert cx18_queue buffers member to atomic_t. This allows safe concurrent access to check if a queue has data without having to acquire the queue spinlock. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-fileops.c')
-rw-r--r--drivers/media/video/cx18/cx18-fileops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/cx18/cx18-fileops.c b/drivers/media/video/cx18/cx18-fileops.c
index 2fdbfb994dd5..eb0144f95562 100644
--- a/drivers/media/video/cx18/cx18-fileops.c
+++ b/drivers/media/video/cx18/cx18-fileops.c
@@ -223,7 +223,7 @@ static struct cx18_buffer *cx18_get_buffer(struct cx18_stream *s, int non_block,
223 prepare_to_wait(&s->waitq, &wait, TASK_INTERRUPTIBLE); 223 prepare_to_wait(&s->waitq, &wait, TASK_INTERRUPTIBLE);
224 /* New buffers might have become available before we were added 224 /* New buffers might have become available before we were added
225 to the waitqueue */ 225 to the waitqueue */
226 if (!s->q_full.buffers) 226 if (!atomic_read(&s->q_full.buffers))
227 schedule(); 227 schedule();
228 finish_wait(&s->waitq, &wait); 228 finish_wait(&s->waitq, &wait);
229 if (signal_pending(current)) { 229 if (signal_pending(current)) {
@@ -509,7 +509,7 @@ unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
509 CX18_DEBUG_HI_FILE("Encoder poll\n"); 509 CX18_DEBUG_HI_FILE("Encoder poll\n");
510 poll_wait(filp, &s->waitq, wait); 510 poll_wait(filp, &s->waitq, wait);
511 511
512 if (s->q_full.buffers || s->q_io.buffers) 512 if (atomic_read(&s->q_full.buffers) || atomic_read(&s->q_io.buffers))
513 return POLLIN | POLLRDNORM; 513 return POLLIN | POLLRDNORM;
514 if (eof) 514 if (eof)
515 return POLLHUP; 515 return POLLHUP;