ide: Fix code dealing with sleeping devices in do_ide_request()
[deliverable/linux.git] / drivers / ide / ide-io.c
index 1adc5e2e7fb3e859e91b7008cc5b9f215e53f020..3c52317d85246e510ec813525b25ec2dffc77936 100644 (file)
@@ -481,11 +481,10 @@ repeat:
                prev_port = hwif->host->cur_port;
                hwif->rq = NULL;
 
-               if (drive->dev_flags & IDE_DFLAG_SLEEPING) {
-                       if (time_before(drive->sleep, jiffies)) {
-                               ide_unlock_port(hwif);
-                               goto plug_device;
-                       }
+               if (drive->dev_flags & IDE_DFLAG_SLEEPING &&
+                   time_after(drive->sleep, jiffies)) {
+                       ide_unlock_port(hwif);
+                       goto plug_device;
                }
 
                if ((hwif->host->host_flags & IDE_HFLAG_SERIALIZE) &&
This page took 0.024851 seconds and 5 git commands to generate.