V4L/DVB (8772): cx18: Convert cx18_queue buffers member to atomic_t
[safe/jmp/linux-2.6] / drivers / media / video / cx18 / cx18-fileops.c
index d0d7888..eb0144f 100644 (file)
@@ -223,7 +223,7 @@ static struct cx18_buffer *cx18_get_buffer(struct cx18_stream *s, int non_block,
                prepare_to_wait(&s->waitq, &wait, TASK_INTERRUPTIBLE);
                /* New buffers might have become available before we were added
                   to the waitqueue */
-               if (!s->q_full.buffers)
+               if (!atomic_read(&s->q_full.buffers))
                        schedule();
                finish_wait(&s->waitq, &wait);
                if (signal_pending(current)) {
@@ -361,7 +361,8 @@ static ssize_t cx18_read(struct cx18_stream *s, char __user *ubuf,
                                cx18_enqueue(s, buf, &s->q_free);
                                cx18_vapi(cx, CX18_CPU_DE_SET_MDL, 5,
                                        s->handle,
-                                       (void *)&cx->scb->cpu_mdl[buf->id] - cx->enc_mem,
+                                       (void __iomem *)&cx->scb->cpu_mdl[buf->id] -
+                                         cx->enc_mem,
                                        1, buf->id, s->buf_size);
                        } else
                                cx18_enqueue(s, buf, &s->q_io);
@@ -508,7 +509,7 @@ unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
        CX18_DEBUG_HI_FILE("Encoder poll\n");
        poll_wait(filp, &s->waitq, wait);
 
-       if (s->q_full.length || s->q_io.length)
+       if (atomic_read(&s->q_full.buffers) || atomic_read(&s->q_io.buffers))
                return POLLIN | POLLRDNORM;
        if (eof)
                return POLLHUP;