libata-acpi: remove redundent code for power resource handling
[cascardo/linux.git] / drivers / ata / libata-scsi.c
index 318b413..fe759ca 100644 (file)
@@ -49,6 +49,7 @@
 #include <linux/hdreg.h>
 #include <linux/uaccess.h>
 #include <linux/suspend.h>
+#include <linux/pm_qos.h>
 #include <asm/unaligned.h>
 
 #include "libata.h"
@@ -532,8 +533,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)
                        struct scsi_sense_hdr sshdr;
                        scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
                                             &sshdr);
-                       if (sshdr.sense_key == 0 &&
-                           sshdr.asc == 0 && sshdr.ascq == 0)
+                       if (sshdr.sense_key == RECOVERED_ERROR &&
+                           sshdr.asc == 0 && sshdr.ascq == 0x1d)
                                cmd_result &= ~SAM_STAT_CHECK_CONDITION;
                }
 
@@ -618,8 +619,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
                        struct scsi_sense_hdr sshdr;
                        scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
                                                &sshdr);
-                       if (sshdr.sense_key == 0 &&
-                               sshdr.asc == 0 && sshdr.ascq == 0)
+                       if (sshdr.sense_key == RECOVERED_ERROR &&
+                           sshdr.asc == 0 && sshdr.ascq == 0x1d)
                                cmd_result &= ~SAM_STAT_CHECK_CONDITION;
                }
 
@@ -3668,7 +3669,9 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)
                        if (!IS_ERR(sdev)) {
                                dev->sdev = sdev;
                                scsi_device_put(sdev);
-                               ata_acpi_bind(dev);
+                               if (zpodd_dev_enabled(dev))
+                                       dev_pm_qos_expose_flags(
+                                                       &sdev->sdev_gendev, 0);
                        } else {
                                dev->sdev = NULL;
                        }
@@ -3767,7 +3770,6 @@ static void ata_scsi_remove_dev(struct ata_device *dev)
 
        if (zpodd_dev_enabled(dev))
                zpodd_exit(dev);
-       ata_acpi_unbind(dev);
 
        /* clearing dev->sdev is protected by host lock */
        sdev = dev->sdev;