提交 422b7595 编写于 作者: T Tejun Heo 提交者: Jeff Garzik

[PATCH] ahci: separate out ahci_dev_classify

Separate out ahci_dev_classify().
Signed-off-by: NTejun Heo <htejun@gmail.com>
Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
上级 7c76d1e8
...@@ -483,10 +483,24 @@ static void ahci_start_engine(struct ata_port *ap) ...@@ -483,10 +483,24 @@ static void ahci_start_engine(struct ata_port *ap)
readl(port_mmio + PORT_CMD); /* flush */ 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; void __iomem *port_mmio = (void __iomem *) ap->ioaddr.cmd_addr;
struct ata_taskfile tf; 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]; struct ata_device *dev = &ap->device[0];
u32 new_tmp, tmp; u32 new_tmp, tmp;
...@@ -495,13 +509,7 @@ static void ahci_phy_reset(struct ata_port *ap) ...@@ -495,13 +509,7 @@ static void ahci_phy_reset(struct ata_port *ap)
if (ap->flags & ATA_FLAG_PORT_DISABLED) if (ap->flags & ATA_FLAG_PORT_DISABLED)
return; return;
tmp = readl(port_mmio + PORT_SIG); dev->class = ahci_dev_classify(ap);
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);
if (!ata_dev_present(dev)) { if (!ata_dev_present(dev)) {
ata_port_disable(ap); ata_port_disable(ap);
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册