[PATCH] libata: Add ->set_mode hook for odd drivers
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Mon, 27 Mar 2006 17:46:37 +0000 (18:46 +0100)
committerJeff Garzik <jeff@garzik.org>
Thu, 30 Mar 2006 00:30:27 +0000 (19:30 -0500)
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.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/scsi/libata-core.c
include/linux/libata.h

index 86310562da8b37f3e5e8e682b545b27b798f7973..10933cb722e65a08891e601d1e0daef848254d90 100644 (file)
@@ -1409,7 +1409,11 @@ static int ata_bus_probe(struct ata_port *ap)
        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;
 
index a5c213ce97c9c3452742df27cfeff38edeb00876..6a9316cbb70b170aeb529e11a39a516ddb9f4ee5 100644 (file)
@@ -433,6 +433,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);