diff options
| author | Tejun Heo <htejun@gmail.com> | 2006-03-12 11:57:01 -0500 |
|---|---|---|
| committer | Jeff Garzik <jeff@garzik.org> | 2006-03-12 12:49:45 -0500 |
| commit | 2044470cccec1bfe6bb819027975df302ff43bf8 (patch) | |
| tree | 64254b2ca55f8727f08e46361532361027cf4faf | |
| parent | 4b10e559277de490bf5c257a1e3264a2bf51404b (diff) | |
[PATCH] libata: fix class handling in ata_bus_probe()
ata_bus_probe() didn't set classes[] properly for port disabled case
of ->phy_reset() compatibility path. This patch moves classes[]
initialization and normalization out of ->probe_reset block such that
it applies to both ->probe_reset and ->phy_reset paths.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
| -rw-r--r-- | drivers/scsi/libata-core.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 42d43b55fb8f..c17df3f22fd1 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
| @@ -1344,32 +1344,30 @@ static int ata_bus_probe(struct ata_port *ap) | |||
| 1344 | 1344 | ||
| 1345 | ata_port_probe(ap); | 1345 | ata_port_probe(ap); |
| 1346 | 1346 | ||
| 1347 | /* reset */ | 1347 | /* reset and determine device classes */ |
| 1348 | if (ap->ops->probe_reset) { | 1348 | for (i = 0; i < ATA_MAX_DEVICES; i++) |
| 1349 | for (i = 0; i < ATA_MAX_DEVICES; i++) | 1349 | classes[i] = ATA_DEV_UNKNOWN; |
| 1350 | classes[i] = ATA_DEV_UNKNOWN; | ||
| 1351 | 1350 | ||
| 1351 | if (ap->ops->probe_reset) { | ||
| 1352 | rc = ap->ops->probe_reset(ap, classes); | 1352 | rc = ap->ops->probe_reset(ap, classes); |
| 1353 | if (rc) { | 1353 | if (rc) { |
| 1354 | printk("ata%u: reset failed (errno=%d)\n", ap->id, rc); | 1354 | printk("ata%u: reset failed (errno=%d)\n", ap->id, rc); |
| 1355 | return rc; | 1355 | return rc; |
| 1356 | } | 1356 | } |
| 1357 | |||
| 1358 | for (i = 0; i < ATA_MAX_DEVICES; i++) | ||
| 1359 | if (classes[i] == ATA_DEV_UNKNOWN) | ||
| 1360 | classes[i] = ATA_DEV_NONE; | ||
| 1361 | } else { | 1357 | } else { |
| 1362 | ap->ops->phy_reset(ap); | 1358 | ap->ops->phy_reset(ap); |
| 1363 | 1359 | ||
| 1364 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 1360 | if (!(ap->flags & ATA_FLAG_PORT_DISABLED)) |
| 1365 | if (!(ap->flags & ATA_FLAG_PORT_DISABLED)) | 1361 | for (i = 0; i < ATA_MAX_DEVICES; i++) |
| 1366 | classes[i] = ap->device[i].class; | 1362 | classes[i] = ap->device[i].class; |
| 1367 | else | 1363 | |
| 1368 | ap->device[i].class = ATA_DEV_UNKNOWN; | ||
| 1369 | } | ||
| 1370 | ata_port_probe(ap); | 1364 | ata_port_probe(ap); |
| 1371 | } | 1365 | } |
| 1372 | 1366 | ||
| 1367 | for (i = 0; i < ATA_MAX_DEVICES; i++) | ||
| 1368 | if (classes[i] == ATA_DEV_UNKNOWN) | ||
| 1369 | classes[i] = ATA_DEV_NONE; | ||
| 1370 | |||
| 1373 | /* read IDENTIFY page and configure devices */ | 1371 | /* read IDENTIFY page and configure devices */ |
| 1374 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 1372 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
| 1375 | struct ata_device *dev = &ap->device[i]; | 1373 | struct ata_device *dev = &ap->device[i]; |
