Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21874
b: refs/heads/master
c: 28ca5c5
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Mar 3, 2006
1 parent e076089 commit 130b8c4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b2f3ededc035525038a7a9247074243dac6b351
refs/heads/master: 28ca5c57dc9f235f7cba609f2b541328de47beb2
46 changes: 25 additions & 21 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1211,35 +1211,40 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev)

static int ata_bus_probe(struct ata_port *ap)
{
unsigned int i, found = 0;
unsigned int classes[ATA_MAX_DEVICES];
unsigned int i, rc, found = 0;

if (ap->ops->probe_reset) {
unsigned int classes[ATA_MAX_DEVICES];
int rc;

ata_port_probe(ap);
ata_port_probe(ap);

/* reset */
if (ap->ops->probe_reset) {
rc = ap->ops->probe_reset(ap, classes);
if (rc == 0) {
for (i = 0; i < ATA_MAX_DEVICES; i++) {
if (classes[i] == ATA_DEV_UNKNOWN)
classes[i] = ATA_DEV_NONE;
ap->device[i].class = classes[i];
}
} else {
printk(KERN_ERR "ata%u: probe reset failed, "
"disabling port\n", ap->id);
ata_port_disable(ap);
if (rc) {
printk("ata%u: reset failed (errno=%d)\n", ap->id, rc);
return rc;
}
} else

for (i = 0; i < ATA_MAX_DEVICES; i++)
if (classes[i] == ATA_DEV_UNKNOWN)
classes[i] = ATA_DEV_NONE;
} else {
ap->ops->phy_reset(ap);

if (ap->flags & ATA_FLAG_PORT_DISABLED)
goto err_out;
for (i = 0; i < ATA_MAX_DEVICES; i++) {
if (!(ap->flags & ATA_FLAG_PORT_DISABLED))
classes[i] = ap->device[i].class;
else
ap->device[i].class = ATA_DEV_UNKNOWN;
}
ata_port_probe(ap);
}

/* read IDENTIFY page and configure devices */
for (i = 0; i < ATA_MAX_DEVICES; i++) {
struct ata_device *dev = &ap->device[i];

dev->class = classes[i];

if (!ata_dev_present(dev))
continue;

Expand All @@ -1257,7 +1262,7 @@ static int ata_bus_probe(struct ata_port *ap)
found = 1;
}

if ((!found) || (ap->flags & ATA_FLAG_PORT_DISABLED))
if (!found)
goto err_out_disable;

ata_set_mode(ap);
Expand All @@ -1268,7 +1273,6 @@ static int ata_bus_probe(struct ata_port *ap)

err_out_disable:
ap->ops->port_disable(ap);
err_out:
return -1;
}

Expand Down

0 comments on commit 130b8c4

Please sign in to comment.