diff options
author | Tejun Heo <htejun@gmail.com> | 2005-12-19 08:37:17 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-17 19:49:10 -0500 |
commit | 422b75956cd11f9d9214e6e2a99d6e52d98812d4 (patch) | |
tree | f7aabb4188b651596431ce344b1529dfa0c0b0b4 /drivers/scsi/ahci.c | |
parent | 7c76d1e83961a4e355c3ebd53191bc6072c238bd (diff) |
[PATCH] ahci: separate out ahci_dev_classify
Separate out ahci_dev_classify().
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/ahci.c')
-rw-r--r-- | drivers/scsi/ahci.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index f3dfdab173f2..30676b0eb366 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c | |||
@@ -483,10 +483,24 @@ static void ahci_start_engine(struct ata_port *ap) | |||
483 | readl(port_mmio + PORT_CMD); /* flush */ | 483 | readl(port_mmio + PORT_CMD); /* flush */ |
484 | } | 484 | } |
485 | 485 | ||
486 | static void ahci_phy_reset(struct ata_port *ap) | 486 | static unsigned int ahci_dev_classify(struct ata_port *ap) |
487 | { | 487 | { |
488 | void __iomem *port_mmio = (void __iomem *) ap->ioaddr.cmd_addr; | 488 | void __iomem *port_mmio = (void __iomem *) ap->ioaddr.cmd_addr; |
489 | struct ata_taskfile tf; | 489 | struct ata_taskfile tf; |
490 | u32 tmp; | ||
491 | |||
492 | tmp = readl(port_mmio + PORT_SIG); | ||
493 | tf.lbah = (tmp >> 24) & 0xff; | ||
494 | tf.lbam = (tmp >> 16) & 0xff; | ||
495 | tf.lbal = (tmp >> 8) & 0xff; | ||
496 | tf.nsect = (tmp) & 0xff; | ||
497 | |||
498 | return ata_dev_classify(&tf); | ||
499 | } | ||
500 | |||
501 | static void ahci_phy_reset(struct ata_port *ap) | ||
502 | { | ||
503 | void __iomem *port_mmio = (void __iomem *) ap->ioaddr.cmd_addr; | ||
490 | struct ata_device *dev = &ap->device[0]; | 504 | struct ata_device *dev = &ap->device[0]; |
491 | u32 new_tmp, tmp; | 505 | u32 new_tmp, tmp; |
492 | 506 | ||
@@ -495,13 +509,7 @@ static void ahci_phy_reset(struct ata_port *ap) | |||
495 | if (ap->flags & ATA_FLAG_PORT_DISABLED) | 509 | if (ap->flags & ATA_FLAG_PORT_DISABLED) |
496 | return; | 510 | return; |
497 | 511 | ||
498 | tmp = readl(port_mmio + PORT_SIG); | 512 | dev->class = ahci_dev_classify(ap); |
499 | tf.lbah = (tmp >> 24) & 0xff; | ||
500 | tf.lbam = (tmp >> 16) & 0xff; | ||
501 | tf.lbal = (tmp >> 8) & 0xff; | ||
502 | tf.nsect = (tmp) & 0xff; | ||
503 | |||
504 | dev->class = ata_dev_classify(&tf); | ||
505 | if (!ata_dev_present(dev)) { | 513 | if (!ata_dev_present(dev)) { |
506 | ata_port_disable(ap); | 514 | ata_port_disable(ap); |
507 | return; | 515 | return; |