public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 5/6] 15/34: cdrom/sjcd: remove sleep_on() usage
@ 2005-03-06 10:32 domen
  0 siblings, 0 replies; only message in thread
From: domen @ 2005-03-06 10:32 UTC (permalink / raw)
  To: emoenke; +Cc: linux-kernel, domen, nacc



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

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
---


 kj-domen/drivers/cdrom/sjcd.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -puN drivers/cdrom/sjcd.c~sleep_on-drivers_cdrom_sjcd drivers/cdrom/sjcd.c
--- kj/drivers/cdrom/sjcd.c~sleep_on-drivers_cdrom_sjcd	2005-03-05 16:11:48.000000000 +0100
+++ kj-domen/drivers/cdrom/sjcd.c	2005-03-05 16:11:48.000000000 +0100
@@ -70,6 +70,7 @@
 #include <linux/string.h>
 #include <linux/major.h>
 #include <linux/init.h>
+#include <linux/wait.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -407,9 +408,12 @@ static void sjcd_status_timer(void)
  */
 static int sjcd_wait_for_status(void)
 {
+	DEFINE_WAIT(wait);
 	sjcd_status_timeout = SJCD_WAIT_FOR_STATUS_TIMEOUT;
 	SJCD_SET_TIMER(sjcd_status_timer, 1);
-	sleep_on(&sjcd_waitq);
+	prepare_to_wait(&sjcd_waitq, &wait, TASK_UNINTERRUPTIBLE);
+	schedule();
+	finish_wait(&sjcd_waitq, &wait);
 #if defined( SJCD_DIAGNOSTIC ) || defined ( SJCD_TRACE )
 	if (sjcd_status_timeout <= 0)
 		printk("SJCD: Error Wait For Status.\n");
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-06 10:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-06 10:32 [patch 5/6] 15/34: cdrom/sjcd: remove sleep_on() usage domen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox