linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] CDROM: replace jiffies busyloop with msleep
@ 2007-05-22 10:25 Thomas Gleixner
  2007-05-22 10:30 ` Jeff Garzik
  2007-05-23 18:41 ` Rene Herman
  0 siblings, 2 replies; 9+ messages in thread
From: Thomas Gleixner @ 2007-05-22 10:25 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Alan Cox, Jeff Garzik

From: Ingo Molnar <mingo@elte.hu>

The SJCD driver uses a jiffies busy loop. Replace it with msleep.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>

---
 drivers/cdrom/sjcd.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/cdrom/sjcd.c
===================================================================
--- linux-2.6.orig/drivers/cdrom/sjcd.c
+++ linux-2.6/drivers/cdrom/sjcd.c
@@ -69,6 +69,7 @@
 #include <linux/string.h>
 #include <linux/major.h>
 #include <linux/init.h>
+#include <linux/delay.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -1709,12 +1710,11 @@ static int __init sjcd_init(void)
 	printk(KERN_INFO "SJCD: Resetting: ");
 	sjcd_send_cmd(SCMD_RESET);
 	for (i = 1000; i > 0 && !sjcd_status_valid; --i) {
-		unsigned long timer;
-
 		/*
 		 * Wait 10ms approx.
 		 */
-		for (timer = jiffies; time_before_eq(jiffies, timer););
+		msleep(10);
+
 		if ((i % 100) == 0)
 			printk(".");
 		(void) sjcd_check_status();



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-05-23 19:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-22 10:25 [PATCH] CDROM: replace jiffies busyloop with msleep Thomas Gleixner
2007-05-22 10:30 ` Jeff Garzik
2007-05-22 11:21   ` Ingo Molnar
2007-05-22 11:20     ` Jens Axboe
2007-05-23 18:41 ` Rene Herman
2007-05-23 19:28   ` Ingo Molnar
2007-05-23 19:37     ` Rene Herman
2007-05-23 19:34   ` Alan Cox
2007-05-23 19:38     ` Rene Herman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).