[PATCH] ahci: separate out ahci_dev_classify
authorTejun Heo <htejun@gmail.com>
Mon, 19 Dec 2005 13:37:17 +0000 (22:37 +0900)
committerJeff Garzik <jgarzik@pobox.com>
Wed, 18 Jan 2006 00:49:10 +0000 (19:49 -0500)
Separate out ahci_dev_classify().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/scsi/ahci.c

index f3dfdab173f2082ce4f8ef61431b81bf496da343..30676b0eb366260ca1f0602a16ff0660f111d5cd 100644 (file)
@@ -483,10 +483,24 @@ static void ahci_start_engine(struct ata_port *ap)
        readl(port_mmio + PORT_CMD); /* flush */
 }
 
-static void ahci_phy_reset(struct ata_port *ap)
+static unsigned int ahci_dev_classify(struct ata_port *ap)
 {
        void __iomem *port_mmio = (void __iomem *) ap->ioaddr.cmd_addr;
        struct ata_taskfile tf;
+       u32 tmp;
+
+       tmp = readl(port_mmio + PORT_SIG);
+       tf.lbah         = (tmp >> 24)   & 0xff;
+       tf.lbam         = (tmp >> 16)   & 0xff;
+       tf.lbal         = (tmp >> 8)    & 0xff;
+       tf.nsect        = (tmp)         & 0xff;
+
+       return ata_dev_classify(&tf);
+}
+
+static void ahci_phy_reset(struct ata_port *ap)
+{
+       void __iomem *port_mmio = (void __iomem *) ap->ioaddr.cmd_addr;
        struct ata_device *dev = &ap->device[0];
        u32 new_tmp, tmp;
 
@@ -495,13 +509,7 @@ static void ahci_phy_reset(struct ata_port *ap)
        if (ap->flags & ATA_FLAG_PORT_DISABLED)
                return;
 
-       tmp = readl(port_mmio + PORT_SIG);
-       tf.lbah         = (tmp >> 24)   & 0xff;
-       tf.lbam         = (tmp >> 16)   & 0xff;
-       tf.lbal         = (tmp >> 8)    & 0xff;
-       tf.nsect        = (tmp)         & 0xff;
-
-       dev->class = ata_dev_classify(&tf);
+       dev->class = ahci_dev_classify(ap);
        if (!ata_dev_present(dev)) {
                ata_port_disable(ap);
                return;
This page took 0.025839 seconds and 5 git commands to generate.