]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/libata-acpi.c
sata_promise: mmio access cleanups
[linux-2.6-omap-h63xx.git] / drivers / ata / libata-acpi.c
index bf98a566adac67c2ec49dc7fc4318fbf15cad68d..70b77e0899a84848d5da89b736505aaee977f2b2 100644 (file)
@@ -77,7 +77,7 @@ void ata_acpi_associate_sata_port(struct ata_port *ap)
 {
        WARN_ON(!(ap->flags & ATA_FLAG_ACPI_SATA));
 
-       if (!ap->nr_pmp_links) {
+       if (!sata_pmp_attached(ap)) {
                acpi_integer adr = SATA_ADR(ap->port_no, NO_PORT_MULT);
 
                ap->link.device->acpi_handle =
@@ -227,11 +227,9 @@ void ata_acpi_associate(struct ata_host *host)
                        acpi_install_notify_handler(ap->acpi_handle,
                                                    ACPI_SYSTEM_NOTIFY,
                                                    ata_acpi_ap_notify, ap);
-#if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE)
                        /* we might be on a docking station */
                        register_hotplug_dock_device(ap->acpi_handle,
                                                     ata_acpi_ap_notify, ap);
-#endif
                }
 
                for (j = 0; j < ata_link_max_devices(&ap->link); j++) {
@@ -241,11 +239,9 @@ void ata_acpi_associate(struct ata_host *host)
                                acpi_install_notify_handler(dev->acpi_handle,
                                                ACPI_SYSTEM_NOTIFY,
                                                ata_acpi_dev_notify, dev);
-#if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE)
                                /* we might be on a docking station */
                                register_hotplug_dock_device(dev->acpi_handle,
                                                ata_acpi_dev_notify, dev);
-#endif
                        }
                }
        }
@@ -839,7 +835,8 @@ void ata_acpi_on_resume(struct ata_port *ap)
                 */
                ata_link_for_each_dev(dev, &ap->link) {
                        ata_acpi_clear_gtf(dev);
-                       if (ata_dev_get_GTF(dev, NULL) >= 0)
+                       if (ata_dev_enabled(dev) &&
+                           ata_dev_get_GTF(dev, NULL) >= 0)
                                dev->flags |= ATA_DFLAG_ACPI_PENDING;
                }
        } else {
@@ -849,7 +846,8 @@ void ata_acpi_on_resume(struct ata_port *ap)
                 */
                ata_link_for_each_dev(dev, &ap->link) {
                        ata_acpi_clear_gtf(dev);
-                       dev->flags |= ATA_DFLAG_ACPI_PENDING;
+                       if (ata_dev_enabled(dev))
+                               dev->flags |= ATA_DFLAG_ACPI_PENDING;
                }
        }
 }