]> git.hungrycats.org Git - linux/commitdiff
[PATCH] janitor: drivers/media: replace schedule_timeout() with msleep()
authorMaximilian Attems <janitor@sternwelten.at>
Tue, 19 Oct 2004 01:22:16 +0000 (18:22 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 19 Oct 2004 01:22:16 +0000 (18:22 -0700)
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Maximilian Attems <janitor@sternwelten.at>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/media/video/bw-qcam.c
drivers/media/video/c-qcam.c
drivers/media/video/cpia.c
drivers/media/video/ovcamchip/ovcamchip_core.c
drivers/media/video/planb.c
drivers/media/video/saa5249.c
drivers/media/video/tda9887.c
drivers/media/video/zoran_driver.c
drivers/media/video/zr36120.c

index 31412e8d32dbc8f3dae696eeeb9010dc1358f9fc..293173885bd94243d14369609936a42b7ccddedc 100644 (file)
@@ -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;
                }
        }
index bd9fef419a88afb585088f3db7ed8549e5d75dae..703c4cba97b6370952ffe289b823d9b3306fc4f8 100644 (file)
@@ -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. */
index 21db4b39027700ec829f1e4ec3dc72fe738c2f36..388bc09366bdbafcc331a6541e0a6eb154d2636d 100644 (file)
@@ -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;
index d88956a26aeef3530d71e34b00ca5623a7733ada..67f2fc4a4f9f2eb68d371a11227028b2bfa00960 100644 (file)
@@ -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);
index ebf130f167e354d9beb9c63678a64b43edab143c..3a828546952a70b74724aa9a05c10f690e451b8b 100644 (file)
@@ -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);
 }
index d486fb7faf67ffcc445ee3e73d4fbe353a1fdce1..7d5ca87c16190fae2b99dfdc21daa96e924f8f7d 100644 (file)
@@ -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;
index e46fbdbc46e656db2349eb98d393c30052d4c4de..31977e770b23591c39f62a6947dbebae58007473 100644 (file)
@@ -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;
index d6294bd7909fcb7fdb667634fc3daf6719cda132..bb2b4201a24d1aa468b4aaba4e93f449f0e407a3 100644 (file)
@@ -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);
index 9b55341baf4099dfa522b9cf3ada64003f7026ce..e99226434e7395e45b7965f2abd98ba884b1feee 100644 (file)
@@ -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++)
        {