aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-05-15 07:57:37 -0400
committerTejun Heo <htejun@gmail.com>2006-05-15 07:57:37 -0400
commit3adcebb2b59d590d572844815c906ca30477b14a (patch)
treee3103126556b5363ae7a30fc967d1ea4645de5a6
parentfe635c7e91036282e4fd0cc5b4eebc712e43270d (diff)
[PATCH] libata: move ->set_mode() handling into ata_set_mode()
Move ->set_mode() handlng into ata_set_mode(). Signed-off-by: Tejun Heo <htejun@gmail.com>
-rw-r--r--drivers/scsi/libata-core.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index af55861a96e2..1efe8a1ba81d 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1426,20 +1426,7 @@ static int ata_bus_probe(struct ata_port *ap)
1426 } 1426 }
1427 1427
1428 /* configure transfer mode */ 1428 /* configure transfer mode */
1429 if (ap->ops->set_mode) { 1429 rc = ata_set_mode(ap, &dev);
1430 /* FIXME: make ->set_mode handle no device case and
1431 * return error code and failing device on failure as
1432 * ata_set_mode() does.
1433 */
1434 for (i = 0; i < ATA_MAX_DEVICES; i++)
1435 if (ata_dev_enabled(&ap->device[i])) {
1436 ap->ops->set_mode(ap);
1437 break;
1438 }
1439 rc = 0;
1440 } else
1441 rc = ata_set_mode(ap, &dev);
1442
1443 if (rc) { 1430 if (rc) {
1444 down_xfermask = 1; 1431 down_xfermask = 1;
1445 goto fail; 1432 goto fail;
@@ -1997,6 +1984,20 @@ int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev)
1997 struct ata_device *dev; 1984 struct ata_device *dev;
1998 int i, rc = 0, used_dma = 0, found = 0; 1985 int i, rc = 0, used_dma = 0, found = 0;
1999 1986
1987 /* has private set_mode? */
1988 if (ap->ops->set_mode) {
1989 /* FIXME: make ->set_mode handle no device case and
1990 * return error code and failing device on failure.
1991 */
1992 for (i = 0; i < ATA_MAX_DEVICES; i++) {
1993 if (ata_dev_enabled(&ap->device[i])) {
1994 ap->ops->set_mode(ap);
1995 break;
1996 }
1997 }
1998 return 0;
1999 }
2000
2000 /* step 1: calculate xfer_mask */ 2001 /* step 1: calculate xfer_mask */
2001 for (i = 0; i < ATA_MAX_DEVICES; i++) { 2002 for (i = 0; i < ATA_MAX_DEVICES; i++) {
2002 unsigned int pio_mask, dma_mask; 2003 unsigned int pio_mask, dma_mask;