Commit e35a9e01 authored by Alan Cox's avatar Alan Cox Committed by Jeff Garzik

[PATCH] libata: Add ->set_mode hook for odd drivers

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: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 4e5ec5db
...@@ -1409,7 +1409,11 @@ static int ata_bus_probe(struct ata_port *ap) ...@@ -1409,7 +1409,11 @@ static int ata_bus_probe(struct ata_port *ap)
if (!found) if (!found)
goto err_out_disable; 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) if (ap->flags & ATA_FLAG_PORT_DISABLED)
goto err_out_disable; goto err_out_disable;
......
...@@ -433,6 +433,7 @@ struct ata_port_operations { ...@@ -433,6 +433,7 @@ struct ata_port_operations {
void (*dev_select)(struct ata_port *ap, unsigned int device); void (*dev_select)(struct ata_port *ap, unsigned int device);
void (*phy_reset) (struct ata_port *ap); /* obsolete */ 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); int (*probe_reset) (struct ata_port *ap, unsigned int *classes);
void (*post_set_mode) (struct ata_port *ap); void (*post_set_mode) (struct ata_port *ap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment