[PATCH] libata: fix ->phy_reset class code handling in ata_bus_probe()
authorTejun Heo <htejun@gmail.com>
Mon, 15 May 2006 11:57:30 +0000 (20:57 +0900)
committerTejun Heo <htejun@gmail.com>
Mon, 15 May 2006 11:57:30 +0000 (20:57 +0900)
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>
drivers/scsi/libata-core.c

index 85a004290072e1b234bfbcac1c272c5029649995..1669dae53ce33a134be4f372591cc081180d5c8b 100644 (file)
@@ -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);
        }