Browse Source

[PATCH] libata: fix ->phy_reset class code handling in ata_bus_probe()

ata_bus_probe() doesn't clear dev->class after ->phy_reset().  This
can result in falsely enabled devices if probing fails.  Clear
dev->class to ATA_DEV_UNKNOWN after fetching it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Tejun Heo 19 years ago
parent
commit
f8c2c4202d
1 changed files with 4 additions and 2 deletions
  1. 4 2
      drivers/scsi/libata-core.c

+ 4 - 2
drivers/scsi/libata-core.c

@@ -1397,9 +1397,11 @@ static int ata_bus_probe(struct ata_port *ap)
 	} else {
 		ap->ops->phy_reset(ap);
 
-		if (!(ap->flags & ATA_FLAG_DISABLED))
-			for (i = 0; i < ATA_MAX_DEVICES; i++)
+		for (i = 0; i < ATA_MAX_DEVICES; i++) {
+			if (!(ap->flags & ATA_FLAG_DISABLED))
 				classes[i] = ap->device[i].class;
+			ap->device[i].class = ATA_DEV_UNKNOWN;
+		}
 
 		ata_port_probe(ap);
 	}