patch-2.1.128 linux/drivers/cdrom/mcdx.c

Next file: linux/drivers/char/bttv.c
Previous file: linux/drivers/block/xd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.127/linux/drivers/cdrom/mcdx.c linux/drivers/cdrom/mcdx.c
@@ -787,23 +787,13 @@
  *	May be we could use a simple count loop w/ jumps to itself, but
  *	I wanna make this independent of cpu speed. [1 jiffy is 1/HZ] sec */
 {
-    unsigned long tout = jiffies + jifs;
-    if (jifs < 0) return;
+	if (jifs < 0) return;
 
-	/* If loaded during kernel boot no *_sleep_on is
-	 * allowed! */
-    if (current->pid == 0) {
-		while (jiffies < tout) {
-            schedule_timeout(0);
-        }
-    } else {
-        current->timeout = tout;
-		xtrace(SLEEP, "*** delay: sleepq\n");
-		interruptible_sleep_on(&stuff->sleepq);
-		xtrace(SLEEP, "delay awoken\n");
-		if (signal_pending(current)) {
-			xtrace(SLEEP, "got signal\n");
-		}
+	xtrace(SLEEP, "*** delay: sleepq\n");
+	interruptible_sleep_on_timeout(&stuff->sleepq, jifs);
+	xtrace(SLEEP, "delay awoken\n");
+	if (signal_pending(current)) {
+		xtrace(SLEEP, "got signal\n");
 	}
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov