]> err.no Git - linux-2.6/blobdiff - drivers/ata/libata-pmp.c
V4L/DVB (7861): mt312: Prefix functions only with mt312_, Add zl10313 to kconfig...
[linux-2.6] / drivers / ata / libata-pmp.c
index 9c998611b6440665e5c11f8880ece0704a7e012d..ff1822a7da38941b4c4cc2051f2bdd4ec80e37a2 100644 (file)
 #include <linux/libata.h>
 #include "libata.h"
 
+const struct ata_port_operations sata_pmp_port_ops = {
+       .inherits               = &sata_port_ops,
+       .pmp_prereset           = ata_std_prereset,
+       .pmp_hardreset          = sata_std_hardreset,
+       .pmp_postreset          = ata_std_postreset,
+       .error_handler          = sata_pmp_error_handler,
+};
+
 /**
  *     sata_pmp_read - read PMP register
  *     @link: link to read PMP register for
@@ -403,7 +411,7 @@ int sata_pmp_attach(struct ata_device *dev)
        int rc;
 
        /* is it hanging off the right place? */
-       if (!(ap->flags & ATA_FLAG_PMP)) {
+       if (!sata_pmp_supported(ap)) {
                ata_dev_printk(dev, KERN_ERR,
                               "host does not support Port Multiplier\n");
                return -EINVAL;
@@ -868,7 +876,7 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
 
  retry:
        /* PMP attached? */
-       if (!ap->nr_pmp_links) {
+       if (!sata_pmp_attached(ap)) {
                rc = ata_eh_recover(ap, ops->prereset, ops->softreset,
                                    ops->hardreset, ops->postreset, NULL);
                if (rc) {
@@ -975,7 +983,7 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
        if (ap->pflags & ATA_PFLAG_UNLOADING)
                return rc;
 
-       if (!ap->nr_pmp_links)
+       if (!sata_pmp_attached(ap))
                goto retry;
 
        if (--pmp_tries) {
@@ -1012,3 +1020,7 @@ void sata_pmp_error_handler(struct ata_port *ap)
        sata_pmp_eh_recover(ap);
        ata_eh_finish(ap);
 }
+
+EXPORT_SYMBOL_GPL(sata_pmp_port_ops);
+EXPORT_SYMBOL_GPL(sata_pmp_qc_defer_cmd_switch);
+EXPORT_SYMBOL_GPL(sata_pmp_error_handler);