Skip to contentSkip to conversation

ide/ide-cd: replace cdrom_sleep() with msleep()

PATCH In review [email protected] 1 participant 1 message Nov 20, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 5/10 ide/ide-cd: replace cdrom_sleep() with msleep()

Any comments would be appreciated.

Description: Uses msleep() in place of cdrom_sleep() to guarantee the task delays as expected.

---

 linux-2.6.10-rc2-bk4-max/drivers/ide/ide-cd.c |   15 +--------------
 1 files changed, 1 insertion(+), 14 deletions(-)
drivers/ide/ide-cd.c renamed from drivers/ide/ide-cd.c~msleep-drivers_ide_ide-cd +1 -14
diff -puN drivers/ide/ide-cd.c~msleep-drivers_ide_ide-cd drivers/ide/ide-cd.c
@@ -1514,19 +1514,6 @@ static ide_startstop_t cdrom_do_packet_c
 }
 
 
-/* Sleep for TIME jiffies.
-   Not to be called from an interrupt handler. */
-static
-void cdrom_sleep (int time)
-{
-	int sleep = time;
-
-	do {
-		set_current_state(TASK_INTERRUPTIBLE);
-		sleep = schedule_timeout(sleep);
-	} while (sleep);
-}
-
 static
 int cdrom_queue_packet_command(ide_drive_t *drive, struct request *rq)
 {
@@ -1561,7 +1548,7 @@ int cdrom_queue_packet_command(ide_drive
 				/* The drive is in the process of loading
 				   a disk.  Retry, but wait a little to give
 				   the drive time to complete the load. */
-				cdrom_sleep(2 * HZ);
+				msleep(2000);
 			} else {
 				/* Otherwise, don't retry. */
 				retries = 0;

_