aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-acpi.c')
-rw-r--r--drivers/ata/libata-acpi.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index c012307d0ba6..ef02e488d468 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -89,7 +89,7 @@ void ata_acpi_associate_sata_port(struct ata_port *ap)
89 89
90 ap->link.device->acpi_handle = NULL; 90 ap->link.device->acpi_handle = NULL;
91 91
92 ata_port_for_each_link(link, ap) { 92 ata_for_each_link(link, ap, EDGE) {
93 acpi_integer adr = SATA_ADR(ap->port_no, link->pmp); 93 acpi_integer adr = SATA_ADR(ap->port_no, link->pmp);
94 94
95 link->device->acpi_handle = 95 link->device->acpi_handle =
@@ -129,8 +129,8 @@ static void ata_acpi_detach_device(struct ata_port *ap, struct ata_device *dev)
129 struct ata_link *tlink; 129 struct ata_link *tlink;
130 struct ata_device *tdev; 130 struct ata_device *tdev;
131 131
132 ata_port_for_each_link(tlink, ap) 132 ata_for_each_link(tlink, ap, EDGE)
133 ata_link_for_each_dev(tdev, tlink) 133 ata_for_each_dev(tdev, tlink, ALL)
134 tdev->flags |= ATA_DFLAG_DETACH; 134 tdev->flags |= ATA_DFLAG_DETACH;
135 } 135 }
136 136
@@ -588,12 +588,9 @@ int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm)
588{ 588{
589 struct ata_device *dev; 589 struct ata_device *dev;
590 590
591 ata_link_for_each_dev(dev, &ap->link) { 591 ata_for_each_dev(dev, &ap->link, ENABLED) {
592 unsigned long xfer_mask, udma_mask; 592 unsigned long xfer_mask, udma_mask;
593 593
594 if (!ata_dev_enabled(dev))
595 continue;
596
597 xfer_mask = ata_acpi_gtm_xfermask(dev, gtm); 594 xfer_mask = ata_acpi_gtm_xfermask(dev, gtm);
598 ata_unpack_xfermask(xfer_mask, NULL, NULL, &udma_mask); 595 ata_unpack_xfermask(xfer_mask, NULL, NULL, &udma_mask);
599 596
@@ -893,7 +890,7 @@ void ata_acpi_on_resume(struct ata_port *ap)
893 * use values set by _STM. Cache _GTF result and 890 * use values set by _STM. Cache _GTF result and
894 * schedule _GTF. 891 * schedule _GTF.
895 */ 892 */
896 ata_link_for_each_dev(dev, &ap->link) { 893 ata_for_each_dev(dev, &ap->link, ALL) {
897 ata_acpi_clear_gtf(dev); 894 ata_acpi_clear_gtf(dev);
898 if (ata_dev_enabled(dev) && 895 if (ata_dev_enabled(dev) &&
899 ata_dev_get_GTF(dev, NULL) >= 0) 896 ata_dev_get_GTF(dev, NULL) >= 0)
@@ -904,7 +901,7 @@ void ata_acpi_on_resume(struct ata_port *ap)
904 * there's no reason to evaluate IDE _GTF early 901 * there's no reason to evaluate IDE _GTF early
905 * without _STM. Clear cache and schedule _GTF. 902 * without _STM. Clear cache and schedule _GTF.
906 */ 903 */
907 ata_link_for_each_dev(dev, &ap->link) { 904 ata_for_each_dev(dev, &ap->link, ALL) {
908 ata_acpi_clear_gtf(dev); 905 ata_acpi_clear_gtf(dev);
909 if (ata_dev_enabled(dev)) 906 if (ata_dev_enabled(dev))
910 dev->flags |= ATA_DFLAG_ACPI_PENDING; 907 dev->flags |= ATA_DFLAG_ACPI_PENDING;
@@ -932,8 +929,8 @@ void ata_acpi_set_state(struct ata_port *ap, pm_message_t state)
932 if (state.event == PM_EVENT_ON) 929 if (state.event == PM_EVENT_ON)
933 acpi_bus_set_power(ap->acpi_handle, ACPI_STATE_D0); 930 acpi_bus_set_power(ap->acpi_handle, ACPI_STATE_D0);
934 931
935 ata_link_for_each_dev(dev, &ap->link) { 932 ata_for_each_dev(dev, &ap->link, ENABLED) {
936 if (dev->acpi_handle && ata_dev_enabled(dev)) 933 if (dev->acpi_handle)
937 acpi_bus_set_power(dev->acpi_handle, 934 acpi_bus_set_power(dev->acpi_handle,
938 state.event == PM_EVENT_ON ? 935 state.event == PM_EVENT_ON ?
939 ACPI_STATE_D0 : ACPI_STATE_D3); 936 ACPI_STATE_D0 : ACPI_STATE_D3);