Commit 4a7b9aa4 authored by Maximilian Attems's avatar Maximilian Attems Committed by Linus Torvalds

[PATCH] janitor: drivers/media: replace schedule_timeout() with msleep()

Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarMaximilian Attems <janitor@sternwelten.at>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 99e017ec
......@@ -249,8 +249,7 @@ static int qc_waithand(struct qcam_device *q, int val)
if(runs++>maxpoll)
{
current->state=TASK_INTERRUPTIBLE;
schedule_timeout(HZ/200);
msleep_interruptible(5);
}
if(runs>(maxpoll+1000)) /* 5 seconds */
return -1;
......@@ -269,8 +268,7 @@ static int qc_waithand(struct qcam_device *q, int val)
if(runs++>maxpoll)
{
current->state=TASK_INTERRUPTIBLE;
schedule_timeout(HZ/200);
msleep_interruptible(5);
}
if(runs++>(maxpoll+1000)) /* 5 seconds */
return -1;
......@@ -302,8 +300,7 @@ static unsigned int qc_waithand2(struct qcam_device *q, int val)
if(runs++>maxpoll)
{
current->state=TASK_INTERRUPTIBLE;
schedule_timeout(HZ/200);
msleep_interruptible(5);
}
if(runs++>(maxpoll+1000)) /* 5 seconds */
return 0;
......@@ -669,8 +666,7 @@ long qc_capture(struct qcam_device * q, char __user *buf, unsigned long len)
time will be 240 / 200 = 1.2 seconds. The compile-time
default is to yield every 4 lines. */
if (i >= yield) {
current->state=TASK_INTERRUPTIBLE;
schedule_timeout(HZ/200);
msleep_interruptible(5);
yield = i + yieldlines;
}
}
......
......@@ -103,8 +103,7 @@ static unsigned int qcam_await_ready1(struct qcam_device *qcam,
{
if (qcam_ready1(qcam) == value)
return 0;
current->state=TASK_INTERRUPTIBLE;
schedule_timeout(HZ/10);
msleep_interruptible(100);
}
/* Probably somebody pulled the plug out. Not much we can do. */
......@@ -129,8 +128,7 @@ static unsigned int qcam_await_ready2(struct qcam_device *qcam, int value)
{
if (qcam_ready2(qcam) == value)
return 0;
current->state=TASK_INTERRUPTIBLE;
schedule_timeout(HZ/10);
msleep_interruptible(100);
}
/* Probably somebody pulled the plug out. Not much we can do. */
......
......@@ -37,6 +37,7 @@
#include <linux/proc_fs.h>
#include <linux/ctype.h>
#include <linux/pagemap.h>
#include <linux/delay.h>
#include <asm/io.h>
#include <asm/semaphore.h>
......@@ -2886,9 +2887,7 @@ static int fetch_frame(void *data)
cond_resched();
/* sleep for 10 ms, hopefully ;) */
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(10*HZ/1000);
msleep_interruptible(10);
if (signal_pending(current))
return -EINTR;
......@@ -2951,8 +2950,7 @@ static int fetch_frame(void *data)
CPIA_GRAB_SINGLE, 0, 0, 0);
/* FIXME: Trial & error - need up to 70ms for
the grab mode change to complete ? */
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(70*HZ / 1000);
msleep_interruptible(70);
if (signal_pending(current))
return -EINTR;
}
......@@ -3003,8 +3001,7 @@ static int goto_high_power(struct cam_data *cam)
{
if (do_command(cam, CPIA_COMMAND_GotoHiPower, 0, 0, 0, 0))
return -EIO;
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(40*HZ/1000); /* windows driver does it too */
msleep_interruptible(40); /* windows driver does it too */
if(signal_pending(current))
return -EINTR;
if (do_command(cam, CPIA_COMMAND_GetCameraStatus, 0, 0, 0, 0))
......@@ -3074,10 +3071,8 @@ static int set_camera_state(struct cam_data *cam)
/* Wait 6 frames for the sensor to get all settings and
AEC/ACB to settle */
current->state = TASK_INTERRUPTIBLE;
schedule_timeout((6*(cam->params.sensorFps.baserate ? 33 : 40) *
(1 << cam->params.sensorFps.divisor) + 10) *
HZ / 1000);
msleep_interruptible(6*(cam->params.sensorFps.baserate ? 33 : 40) *
(1 << cam->params.sensorFps.divisor) + 10);
if(signal_pending(current))
return -EINTR;
......
......@@ -15,6 +15,7 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include "ovcamchip_priv.h"
#define DRIVER_VERSION "v2.27 for Linux 2.6"
......@@ -128,8 +129,7 @@ static int init_camchip(struct i2c_client *c)
ov_write(c, 0x12, 0x80);
/* Wait for it to initialize */
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1 + 150 * HZ / 1000);
msleep(150);
for (i = 0, success = 0; i < I2C_DETECT_RETRIES && !success; i++) {
if (ov_read(c, GENERIC_REG_ID_HIGH, &high) >= 0) {
......@@ -145,8 +145,7 @@ static int init_camchip(struct i2c_client *c)
ov_write(c, 0x12, 0x80);
/* Wait for it to initialize */
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1 + 150 * HZ / 1000);
msleep(150);
/* Dummy read to sync I2C */
ov_read(c, 0x00, &low);
......
......@@ -178,8 +178,7 @@ static unsigned char saa_status(int byte, struct planb *pb)
saa_write_reg (SAA7196_STDC, saa_regs[pb->win.norm][SAA7196_STDC]);
/* Let's wait 30msec for this one */
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(30 * HZ / 1000);
msleep_interruptible(30);
return (unsigned char)in_8 (&planb_regs->saa_status);
}
......
......@@ -273,8 +273,7 @@ static void jdelay(unsigned long delay)
sigfillset(&current->blocked);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(delay);
msleep_interruptible(jiffies_to_msecs(delay));
spin_lock_irq(&current->sighand->siglock);
current->blocked = oldblocked;
......
......@@ -6,6 +6,7 @@
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <media/audiochip.h>
#include <media/tuner.h>
......@@ -543,8 +544,7 @@ static int tda9887_configure(struct tda9887 *t)
printk(PREFIX "i2c i/o error: rc == %d (should be 4)\n",rc);
if (debug > 2) {
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ);
msleep_interruptible(1000);
tda9887_status(t);
}
return 0;
......
......@@ -1917,8 +1917,7 @@ zoran_set_norm (struct zoran *zr,
decoder_command(zr, DECODER_SET_NORM, &norm);
/* let changes come into effect */
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(2 * HZ);
ssleep(2);
decoder_command(zr, DECODER_GET_STATUS, &status);
if (!(status & DECODER_STATUS_GOOD)) {
......@@ -2639,8 +2638,7 @@ zoran_do_ioctl (struct inode *inode,
decoder_command(zr, DECODER_SET_NORM, &norm);
/* sleep 1 second */
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(1 * HZ);
ssleep(1);
/* Get status of video decoder */
decoder_command(zr, DECODER_GET_STATUS, &status);
......
......@@ -819,8 +819,7 @@ void zoran_close(struct video_device* dev)
* be sure its safe to free the buffer. We wait 5-6 fields
* which is more than sufficient to be sure.
*/
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(HZ/10); /* Wait 1/10th of a second */
msleep(100); /* Wait 1/10th of a second */
/* free the allocated framebuffer */
if (ztv->fbuffer)
......@@ -1568,8 +1567,7 @@ void vbi_close(struct video_device *dev)
* be sure its safe to free the buffer. We wait 5-6 fields
* which is more than sufficient to be sure.
*/
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(HZ/10); /* Wait 1/10th of a second */
msleep(100); /* Wait 1/10th of a second */
for (item=ztv->readinfo; item!=ztv->readinfo+ZORAN_VBI_BUFFERS; item++)
{
......
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