Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dab632e8c483532bd84e1f3401c72612e39a7c40
Commit:     dab632e8c483532bd84e1f3401c72612e39a7c40
Parent:     ab2181cf390902f0371f30e4ebeb407b4aaa7314
Author:     Jeff Garzik <[EMAIL PROTECTED]>
AuthorDate: Mon May 28 08:33:01 2007 -0400
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Mon Jul 9 12:17:34 2007 -0400

    [libata] ahci: minor internal cleanups
    
    Minor cleanups, in preparation for merging Marvell PATA AHCI support in
    the future.
    
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/ahci.c |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 779a2b0..b14e7ef 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -229,6 +229,9 @@ static void ahci_error_handler(struct ata_port *ap);
 static void ahci_vt8251_error_handler(struct ata_port *ap);
 static void ahci_post_internal_cmd(struct ata_queued_cmd *qc);
 static int ahci_port_resume(struct ata_port *ap);
+static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl);
+static void ahci_fill_cmd_slot(struct ahci_port_priv *pp, unsigned int tag,
+                              u32 opts);
 #ifdef CONFIG_PM
 static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg);
 static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
@@ -481,11 +484,17 @@ static inline int ahci_nr_ports(u32 cap)
        return (cap & 0x1f) + 1;
 }
 
-static inline void __iomem *ahci_port_base(struct ata_port *ap)
+static inline void __iomem *__ahci_port_base(struct ata_host *host,
+                                            unsigned int port_no)
 {
-       void __iomem *mmio = ap->host->iomap[AHCI_PCI_BAR];
+       void __iomem *mmio = host->iomap[AHCI_PCI_BAR];
 
-       return mmio + 0x100 + (ap->port_no * 0x80);
+       return mmio + 0x100 + (port_no * 0x80);
+}
+
+static inline void __iomem *ahci_port_base(struct ata_port *ap)
+{
+       return __ahci_port_base(ap->host, ap->port_no);
 }
 
 /**
@@ -1750,14 +1759,18 @@ static int ahci_init_one(struct pci_dev *pdev, const 
struct pci_device_id *ent)
        host->private_data = hpriv;
 
        for (i = 0; i < host->n_ports; i++) {
-               if (hpriv->port_map & (1 << i)) {
-                       struct ata_port *ap = host->ports[i];
-                       void __iomem *port_mmio = ahci_port_base(ap);
+               struct ata_port *ap = host->ports[i];
+               void __iomem *port_mmio = ahci_port_base(ap);
 
+               /* standard SATA port setup */
+               if (hpriv->port_map & (1 << i)) {
                        ap->ioaddr.cmd_addr = port_mmio;
                        ap->ioaddr.scr_addr = port_mmio + PORT_SCR;
-               } else
-                       host->ports[i]->ops = &ata_dummy_port_ops;
+               }
+
+               /* disabled/not-implemented port */
+               else
+                       ap->ops = &ata_dummy_port_ops;
        }
 
        /* initialize adapter */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to