diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 8a52dab412e2a8013f36bd547460924c79c996aa..1c33f78040c641b31d6b52d8d31478812ad8e765 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include "libata.h" @@ -1020,38 +1019,6 @@ void ata_acpi_on_disable(struct ata_device *dev) 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; diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index ff44787e5a457930dc8580ed72cb09386a8acf13..fe759cafc67ab95cc77be5d8d8747f55a557ec1e 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include "libata.h" @@ -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;