#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
-#include <linux/pm_qos.h>
#include <scsi/scsi_device.h>
#include "libata.h"
ata_acpi_clear_gtf(dev);
}
-static void ata_acpi_register_power_resource(struct ata_device *dev)
-{
- struct scsi_device *sdev = dev->sdev;
- acpi_handle handle;
-
- handle = ata_dev_acpi_handle(dev);
- if (handle)
- acpi_dev_pm_add_dependent(handle, &sdev->sdev_gendev);
-}
-
-static void ata_acpi_unregister_power_resource(struct ata_device *dev)
-{
- struct scsi_device *sdev = dev->sdev;
- acpi_handle handle;
-
- handle = ata_dev_acpi_handle(dev);
- if (handle)
- acpi_dev_pm_remove_dependent(handle, &sdev->sdev_gendev);
-}
-
-void ata_acpi_bind(struct ata_device *dev)
-{
- ata_acpi_register_power_resource(dev);
- if (zpodd_dev_enabled(dev))
- dev_pm_qos_expose_flags(&dev->sdev->sdev_gendev, 0);
-}
-
-void ata_acpi_unbind(struct ata_device *dev)
-{
- ata_acpi_unregister_power_resource(dev);
-}
-
static int compat_pci_ata(struct ata_port *ap)
{
struct device *dev = ap->tdev.parent;
#include <linux/hdreg.h>
#include <linux/uaccess.h>
#include <linux/suspend.h>
+#include <linux/pm_qos.h>
#include <asm/unaligned.h>
#include "libata.h"
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;
}
if (zpodd_dev_enabled(dev))
zpodd_exit(dev);
- ata_acpi_unbind(dev);
/* clearing dev->sdev is protected by host lock */
sdev = dev->sdev;