From f8c2c4202d86e14ca03b7adc7ebcb30fc74b24e1 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Mon, 15 May 2006 20:57:30 +0900 Subject: [PATCH] [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 --- drivers/scsi/libata-core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 85a004290072..1669dae53ce3 100644 --- a/drivers/scsi/libata-core.c +++ b/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); } -- 2.20.1