Skip to contentSkip to conversation

libata: allow ->probe_reset to return ATA_DEV_UNKNOWN

PATCH Applied Tejun Heo 2 participants 2 messages Feb 12, 2006

Subsystems (2)
lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 libata: allow ->probe_reset to return ATA_DEV_UNKNOWN

[PATCH] libata: allow ->probe_reset to return ATA_DEV_UNKNOWN

This patch makes ata_bus_probe() normalize classes[] returned by ->probe_reset such that ->probe_reset can return ATA_DEV_UNKNOWN. This eases implementation of ->probe_reset's which don't directly use ata_drive_probe_reset().

drivers/scsi/libata-core.c +4 -1
Index: work1/drivers/scsi/libata-core.c
===================================================================
@@ -1142,8 +1142,11 @@ static int ata_bus_probe(struct ata_port
 
 		rc = ap->ops->probe_reset(ap, classes);
 		if (rc == 0) {
-			for (i = 0; i < ATA_MAX_DEVICES; i++)
+			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);
Applied
#1 lore raw
Quoted 8 lines · Tejun Heo

[PATCH] libata: allow ->probe_reset to return ATA_DEV_UNKNOWN

This patch makes ata_bus_probe() normalize classes[] returned by ->probe_reset such that ->probe_reset can return ATA_DEV_UNKNOWN. This eases implementation of ->probe_reset's which don't directly use ata_drive_probe_reset().

applied