Skip to contentSkip to conversation

PATCH: Add ->set_mode hook for odd drivers

PATCH Applied Alan Cox 2 participants 2 messages Mar 27, 2006 – Mar 30, 2006

Subsystems (2)
lore
Share & tools
lore

Alan Cox

author
#0 lore raw

Some hardware doesn't want the usual mode setup logic running. This allows the hardware driver to replace it for special cases in the least invasive way possible.

drivers/scsi/libata-core.c +5 -1
index 1cb9813..18d5239 100644
@@ -1409,7 +1415,11 @@ static int ata_bus_probe(struct ata_port
 	if (!found)
 		goto err_out_disable;
 
-	ata_set_mode(ap);
+	if (ap->ops->set_mode)
+		ap->ops->set_mode(ap);
+	else
+		ata_set_mode(ap);
+
 	if (ap->flags & ATA_FLAG_PORT_DISABLED)
 		goto err_out_disable;
 
include/linux/libata.h +1 -0
index 9fcc061..26e0351 100644
@@ -429,6 +438,7 @@ struct ata_port_operations {
 	void (*dev_select)(struct ata_port *ap, unsigned int device);
 
 	void (*phy_reset) (struct ata_port *ap); /* obsolete */
+	void (*set_mode) (struct ata_port *ap);
 	int (*probe_reset) (struct ata_port *ap, unsigned int *classes);
 
 	void (*post_set_mode) (struct ata_port *ap);