lkml.org 
[lkml]   [2007]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] CDROM: replace jiffies busyloop with msleep
From
Date
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();

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-05-22 12:27    [W:0.527 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site