Commit 50b5642a authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] media/zoran_driver: replace interruptible_sleep_on_timeout() with...

[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: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarDomen Puncer <domen@coderock.org>
Signed-off-by: default avatarGerd Knorr <kraxel@bytesex.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 98dcb39d
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/wait.h>
#include <linux/byteorder/generic.h> #include <linux/byteorder/generic.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -918,12 +919,12 @@ v4l_sync (struct file *file, ...@@ -918,12 +919,12 @@ v4l_sync (struct file *file,
} }
/* wait on this buffer to get ready */ /* wait on this buffer to get ready */
while (zr->v4l_buffers.buffer[frame].state == BUZ_STATE_PEND) { if (!wait_event_interruptible_timeout(zr->v4l_capq,
if (!interruptible_sleep_on_timeout(&zr->v4l_capq, 10 * HZ)) (zr->v4l_buffers.buffer[frame].state != BUZ_STATE_PEND),
return -ETIME; 10*HZ))
else if (signal_pending(current)) return -ETIME;
return -ERESTARTSYS; if (signal_pending(current))
} return -ERESTARTSYS;
/* buffer should now be in BUZ_STATE_DONE */ /* buffer should now be in BUZ_STATE_DONE */
if (zr->v4l_buffers.buffer[frame].state != BUZ_STATE_DONE) if (zr->v4l_buffers.buffer[frame].state != BUZ_STATE_DONE)
...@@ -1107,7 +1108,7 @@ jpg_sync (struct file *file, ...@@ -1107,7 +1108,7 @@ jpg_sync (struct file *file,
struct zoran_fh *fh = file->private_data; struct zoran_fh *fh = file->private_data;
struct zoran *zr = fh->zr; struct zoran *zr = fh->zr;
unsigned long flags; unsigned long flags;
int frame, timeout; int frame;
if (fh->jpg_buffers.active == ZORAN_FREE) { if (fh->jpg_buffers.active == ZORAN_FREE) {
dprintk(1, dprintk(1,
...@@ -1124,29 +1125,26 @@ jpg_sync (struct file *file, ...@@ -1124,29 +1125,26 @@ jpg_sync (struct file *file,
ZR_DEVNAME(zr)); ZR_DEVNAME(zr));
return -EINVAL; return -EINVAL;
} }
while (zr->jpg_que_tail == zr->jpg_dma_tail) { if (!wait_event_interruptible_timeout(zr->jpg_capq,
if (zr->jpg_dma_tail == zr->jpg_dma_head) (zr->jpg_que_tail != zr->jpg_dma_tail ||
break; zr->jpg_dma_tail == zr->jpg_dma_head),
10*HZ)) {
int isr;
timeout = btand(~ZR36057_JMC_Go_en, ZR36057_JMC);
interruptible_sleep_on_timeout(&zr->jpg_capq, 10 * HZ); udelay(1);
if (!timeout) { zr->codec->control(zr->codec, CODEC_G_STATUS,
int isr;
btand(~ZR36057_JMC_Go_en, ZR36057_JMC);
udelay(1);
zr->codec->control(zr->codec, CODEC_G_STATUS,
sizeof(isr), &isr); sizeof(isr), &isr);
dprintk(1, dprintk(1,
KERN_ERR KERN_ERR
"%s: jpg_sync() - timeout: codec isr=0x%02x\n", "%s: jpg_sync() - timeout: codec isr=0x%02x\n",
ZR_DEVNAME(zr), isr); 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); spin_lock_irqsave(&zr->spinlock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment