cmd64x: remove no longer needed debugging code
[safe/jmp/linux-2.6] / drivers / ide / ide-pm.c
index ba1488b..ad7be26 100644 (file)
@@ -3,15 +3,18 @@
 
 int generic_ide_suspend(struct device *dev, pm_message_t mesg)
 {
-       ide_drive_t *drive = dev->driver_data, *pair = ide_get_pair_dev(drive);
+       ide_drive_t *drive = dev_get_drvdata(dev);
+       ide_drive_t *pair = ide_get_pair_dev(drive);
        ide_hwif_t *hwif = drive->hwif;
        struct request *rq;
        struct request_pm_state rqpm;
        int ret;
 
-       /* call ACPI _GTM only once */
-       if ((drive->dn & 1) == 0 || pair == NULL)
-               ide_acpi_get_timing(hwif);
+       if (ide_port_acpi(hwif)) {
+               /* call ACPI _GTM only once */
+               if ((drive->dn & 1) == 0 || pair == NULL)
+                       ide_acpi_get_timing(hwif);
+       }
 
        memset(&rqpm, 0, sizeof(rqpm));
        rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
@@ -25,28 +28,33 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg)
        ret = blk_execute_rq(drive->queue, NULL, rq, 0);
        blk_put_request(rq);
 
-       /* call ACPI _PS3 only after both devices are suspended */
-       if (ret == 0 && ((drive->dn & 1) || pair == NULL))
-               ide_acpi_set_state(hwif, 0);
+       if (ret == 0 && ide_port_acpi(hwif)) {
+               /* call ACPI _PS3 only after both devices are suspended */
+               if ((drive->dn & 1) || pair == NULL)
+                       ide_acpi_set_state(hwif, 0);
+       }
 
        return ret;
 }
 
 int generic_ide_resume(struct device *dev)
 {
-       ide_drive_t *drive = dev->driver_data, *pair = ide_get_pair_dev(drive);
+       ide_drive_t *drive = dev_get_drvdata(dev);
+       ide_drive_t *pair = ide_get_pair_dev(drive);
        ide_hwif_t *hwif = drive->hwif;
        struct request *rq;
        struct request_pm_state rqpm;
        int err;
 
-       /* call ACPI _PS0 / _STM only once */
-       if ((drive->dn & 1) == 0 || pair == NULL) {
-               ide_acpi_set_state(hwif, 1);
-               ide_acpi_push_timing(hwif);
-       }
+       if (ide_port_acpi(hwif)) {
+               /* call ACPI _PS0 / _STM only once */
+               if ((drive->dn & 1) == 0 || pair == NULL) {
+                       ide_acpi_set_state(hwif, 1);
+                       ide_acpi_push_timing(hwif);
+               }
 
-       ide_acpi_exec_tfs(drive);
+               ide_acpi_exec_tfs(drive);
+       }
 
        memset(&rqpm, 0, sizeof(rqpm));
        rq = blk_get_request(drive->queue, READ, __GFP_WAIT);