ChangeSet 1.2065.3.37, 2005/03/12 08:30:39-08:00, [EMAIL PROTECTED]

        [PATCH] media/zoran_driver: replace interruptible_sleep_on_timeout() 
with wait_event_interruptible_timeout()
        
        Use wait_event_interruptible_timeout() instead of the deprecated
        interruptible_sleep_on_timeout().  Patch is compile-tested.
        
        Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]>
        Signed-off-by: Domen Puncer <[EMAIL PROTECTED]>
        Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 zoran_driver.c |   50 ++++++++++++++++++++++++--------------------------
 1 files changed, 24 insertions(+), 26 deletions(-)


diff -Nru a/drivers/media/video/zoran_driver.c 
b/drivers/media/video/zoran_driver.c
--- a/drivers/media/video/zoran_driver.c        2005-03-12 21:32:29 -08:00
+++ b/drivers/media/video/zoran_driver.c        2005-03-12 21:32:29 -08:00
@@ -52,6 +52,7 @@
 #include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/vmalloc.h>
+#include <linux/wait.h>
 #include <linux/byteorder/generic.h>
 
 #include <linux/interrupt.h>
@@ -918,12 +919,12 @@
        }
 
        /* wait on this buffer to get ready */
-       while (zr->v4l_buffers.buffer[frame].state == BUZ_STATE_PEND) {
-               if (!interruptible_sleep_on_timeout(&zr->v4l_capq, 10 * HZ))
-                       return -ETIME;
-               else if (signal_pending(current))
-                       return -ERESTARTSYS;
-       }
+       if (!wait_event_interruptible_timeout(zr->v4l_capq,
+                               (zr->v4l_buffers.buffer[frame].state != 
BUZ_STATE_PEND),
+                               10*HZ))
+               return -ETIME;
+       if (signal_pending(current))
+               return -ERESTARTSYS;
 
        /* buffer should now be in BUZ_STATE_DONE */
        if (zr->v4l_buffers.buffer[frame].state != BUZ_STATE_DONE)
@@ -1107,7 +1108,7 @@
        struct zoran_fh *fh = file->private_data;
        struct zoran *zr = fh->zr;
        unsigned long flags;
-       int frame, timeout;
+       int frame;
 
        if (fh->jpg_buffers.active == ZORAN_FREE) {
                dprintk(1,
@@ -1124,29 +1125,26 @@
                        ZR_DEVNAME(zr));
                return -EINVAL;
        }
-       while (zr->jpg_que_tail == zr->jpg_dma_tail) {
-               if (zr->jpg_dma_tail == zr->jpg_dma_head)
-                       break;
-
-               timeout =
-                   interruptible_sleep_on_timeout(&zr->jpg_capq, 10 * HZ);
-               if (!timeout) {
-                       int isr;
-
-                       btand(~ZR36057_JMC_Go_en, ZR36057_JMC);
-                       udelay(1);
-                       zr->codec->control(zr->codec, CODEC_G_STATUS,
+       if (!wait_event_interruptible_timeout(zr->jpg_capq,
+                       (zr->jpg_que_tail != zr->jpg_dma_tail ||
+                        zr->jpg_dma_tail == zr->jpg_dma_head),
+                       10*HZ)) {
+               int isr;
+
+               btand(~ZR36057_JMC_Go_en, ZR36057_JMC);
+               udelay(1);
+               zr->codec->control(zr->codec, CODEC_G_STATUS,
                                           sizeof(isr), &isr);
-                       dprintk(1,
-                               KERN_ERR
-                               "%s: jpg_sync() - timeout: codec isr=0x%02x\n",
-                               ZR_DEVNAME(zr), isr);
+               dprintk(1,
+                       KERN_ERR
+                       "%s: jpg_sync() - timeout: codec isr=0x%02x\n",
+                       ZR_DEVNAME(zr), isr);
 
-                       return -ETIME;
+               return -ETIME;
 
-               } else if (signal_pending(current))
-                       return -ERESTARTSYS;
        }
+       if (signal_pending(current))
+               return -ERESTARTSYS;
 
        spin_lock_irqsave(&zr->spinlock, flags);
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to