Merge branch 'x86-kbuild-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / drivers / ata / libata-acpi.c
index 246987f..01964b6 100644 (file)
@@ -83,7 +83,7 @@ void ata_acpi_associate_sata_port(struct ata_port *ap)
 
                ap->link.device->acpi_handle = NULL;
 
-               ata_port_for_each_link(link, ap) {
+               ata_for_each_link(link, ap, EDGE) {
                        acpi_integer adr = SATA_ADR(ap->port_no, link->pmp);
 
                        link->device->acpi_handle =
@@ -123,8 +123,8 @@ static void ata_acpi_detach_device(struct ata_port *ap, struct ata_device *dev)
                struct ata_link *tlink;
                struct ata_device *tdev;
 
-               ata_port_for_each_link(tlink, ap)
-                       ata_link_for_each_dev(tdev, tlink)
+               ata_for_each_link(tlink, ap, EDGE)
+                       ata_for_each_dev(tdev, tlink, ALL)
                                tdev->flags |= ATA_DFLAG_DETACH;
        }
 
@@ -582,12 +582,9 @@ int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm)
 {
        struct ata_device *dev;
 
-       ata_link_for_each_dev(dev, &ap->link) {
+       ata_for_each_dev(dev, &ap->link, ENABLED) {
                unsigned long xfer_mask, udma_mask;
 
-               if (!ata_dev_enabled(dev))
-                       continue;
-
                xfer_mask = ata_acpi_gtm_xfermask(dev, gtm);
                ata_unpack_xfermask(xfer_mask, NULL, NULL, &udma_mask);
 
@@ -692,6 +689,7 @@ static int ata_acpi_run_tf(struct ata_device *dev,
        struct ata_taskfile tf, ptf, rtf;
        unsigned int err_mask;
        const char *level;
+       const char *descr;
        char msg[60];
        int rc;
 
@@ -739,11 +737,13 @@ static int ata_acpi_run_tf(struct ata_device *dev,
                snprintf(msg, sizeof(msg), "filtered out");
                rc = 0;
        }
+       descr = ata_get_cmd_descript(tf.command);
 
        ata_dev_printk(dev, level,
-                      "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x %s\n",
+                      "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x (%s) %s\n",
                       tf.command, tf.feature, tf.nsect, tf.lbal,
-                      tf.lbam, tf.lbah, tf.device, msg);
+                      tf.lbam, tf.lbah, tf.device,
+                      (descr ? descr : "unknown"), msg);
 
        return rc;
 }
@@ -751,9 +751,9 @@ static int ata_acpi_run_tf(struct ata_device *dev,
 /**
  * ata_acpi_exec_tfs - get then write drive taskfile settings
  * @dev: target ATA device
- * @nr_executed: out paramter for the number of executed commands
+ * @nr_executed: out parameter for the number of executed commands
  *
- * Evaluate _GTF and excute returned taskfiles.
+ * Evaluate _GTF and execute returned taskfiles.
  *
  * LOCKING:
  * EH context.
@@ -887,7 +887,7 @@ void ata_acpi_on_resume(struct ata_port *ap)
                 * use values set by _STM.  Cache _GTF result and
                 * schedule _GTF.
                 */
-               ata_link_for_each_dev(dev, &ap->link) {
+               ata_for_each_dev(dev, &ap->link, ALL) {
                        ata_acpi_clear_gtf(dev);
                        if (ata_dev_enabled(dev) &&
                            ata_dev_get_GTF(dev, NULL) >= 0)
@@ -898,7 +898,7 @@ void ata_acpi_on_resume(struct ata_port *ap)
                 * there's no reason to evaluate IDE _GTF early
                 * without _STM.  Clear cache and schedule _GTF.
                 */
-               ata_link_for_each_dev(dev, &ap->link) {
+               ata_for_each_dev(dev, &ap->link, ALL) {
                        ata_acpi_clear_gtf(dev);
                        if (ata_dev_enabled(dev))
                                dev->flags |= ATA_DFLAG_ACPI_PENDING;
@@ -926,8 +926,8 @@ void ata_acpi_set_state(struct ata_port *ap, pm_message_t state)
        if (state.event == PM_EVENT_ON)
                acpi_bus_set_power(ap->acpi_handle, ACPI_STATE_D0);
 
-       ata_link_for_each_dev(dev, &ap->link) {
-               if (dev->acpi_handle && ata_dev_enabled(dev))
+       ata_for_each_dev(dev, &ap->link, ENABLED) {
+               if (dev->acpi_handle)
                        acpi_bus_set_power(dev->acpi_handle,
                                state.event == PM_EVENT_ON ?
                                        ACPI_STATE_D0 : ACPI_STATE_D3);