X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fata%2Flibata-core.c;h=a927c4c8bef31a755fe6a95d724105040c6aef3f;hb=0529c159dbdd79794796c1b50b39442d72efbe97;hp=781d0959a228bde44e520dbd831ff912bd4557bc;hpb=9ac7849e35f705830f7b016ff272b0ff1f7ff759;p=powerpc.git diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 781d0959a2..a927c4c8be 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -5991,6 +5991,23 @@ void ata_port_detach(struct ata_port *ap) scsi_remove_host(ap->scsi_host); } +/** + * ata_host_detach - Detach all ports of an ATA host + * @host: Host to detach + * + * Detach all ports of @host. + * + * LOCKING: + * Kernel thread context (may sleep). + */ +void ata_host_detach(struct ata_host *host) +{ + int i; + + for (i = 0; i < host->n_ports; i++) + ata_port_detach(host->ports[i]); +} + /** * ata_host_remove - PCI layer callback for device removal * @host: ATA host set that was removed @@ -6006,8 +6023,7 @@ void ata_host_remove(struct ata_host *host) { unsigned int i; - for (i = 0; i < host->n_ports; i++) - ata_port_detach(host->ports[i]); + ata_host_detach(host); free_irq(host->irq, host); if (host->irq2) @@ -6382,7 +6398,7 @@ EXPORT_SYMBOL_GPL(ata_std_bios_param); EXPORT_SYMBOL_GPL(ata_std_ports); EXPORT_SYMBOL_GPL(ata_host_init); EXPORT_SYMBOL_GPL(ata_device_add); -EXPORT_SYMBOL_GPL(ata_port_detach); +EXPORT_SYMBOL_GPL(ata_host_detach); EXPORT_SYMBOL_GPL(ata_host_remove); EXPORT_SYMBOL_GPL(ata_sg_init); EXPORT_SYMBOL_GPL(ata_sg_init_one);