Skip to contentSkip to conversation

13/34: cdrom/mcd: remove sleep_on() usage

PATCH New Nishanth Aravamudan 1 participant 1 message Jan 25, 2005 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 13/34: cdrom/mcd: remove sleep_on() usage

Hi,

Please consider applying.

Description: Directly use wait-queues instead of the deprecated sleep_on(). This required adding a local waitqueue. Patch is compile-tested.

drivers/cdrom/mcd.c +5 -1
@@ -95,6 +95,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/config.h>
+#include <linux/wait.h>
 
 /* #define REALLY_SLOW_IO  */
 #include <asm/system.h>
@@ -1273,11 +1274,14 @@ static void mcdStatTimer(unsigned long d
 static int getMcdStatus(int timeout)
 {
 	int st;
+	DEFINE_WAIT(wait);
 
+	prepare_to_wait(&mcd_waitq, &wait, TASK_UNINTERRUPTIBLE);
 	McdTimeout = timeout;
 	mcd_timer.function = mcdStatTimer;
 	mod_timer(&mcd_timer, jiffies + 1);
-	sleep_on(&mcd_waitq);
+	schedule();
+	finish_wait(&mcd_waitq, &wait);
 	if (McdTimeout <= 0)
 		return -1;
 

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors