aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 649dfa57e51c..d72568392e6c 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1784,37 +1784,24 @@ err_out:
1784 return rc; 1784 return rc;
1785} 1785}
1786 1786
1787static void ahci_remove_one (struct pci_dev *pdev) 1787static void ahci_remove_one(struct pci_dev *pdev)
1788{ 1788{
1789 struct device *dev = pci_dev_to_dev(pdev); 1789 struct device *dev = pci_dev_to_dev(pdev);
1790 struct ata_host *host = dev_get_drvdata(dev); 1790 struct ata_host *host = dev_get_drvdata(dev);
1791 struct ahci_host_priv *hpriv = host->private_data; 1791 struct ahci_host_priv *hpriv = host->private_data;
1792 unsigned int i;
1793 int have_msi;
1794 1792
1795 ata_host_detach(host); 1793 ata_host_remove(host);
1796 1794
1797 have_msi = hpriv->flags & AHCI_FLAG_MSI;
1798 free_irq(host->irq, host);
1799
1800 for (i = 0; i < host->n_ports; i++) {
1801 struct ata_port *ap = host->ports[i];
1802
1803 ata_scsi_release(ap->scsi_host);
1804 scsi_host_put(ap->scsi_host);
1805 }
1806
1807 kfree(hpriv);
1808 pci_iounmap(pdev, host->mmio_base); 1795 pci_iounmap(pdev, host->mmio_base);
1809 kfree(host);
1810 1796
1811 if (have_msi) 1797 if (hpriv->flags & AHCI_FLAG_MSI)
1812 pci_disable_msi(pdev); 1798 pci_disable_msi(pdev);
1813 else 1799 else
1814 pci_intx(pdev, 0); 1800 pci_intx(pdev, 0);
1815 pci_release_regions(pdev); 1801 pci_release_regions(pdev);
1816 pci_disable_device(pdev); 1802 pci_disable_device(pdev);
1817 dev_set_drvdata(dev, NULL); 1803 dev_set_drvdata(dev, NULL);
1804 kfree(hpriv);
1818} 1805}
1819 1806
1820static int __init ahci_init(void) 1807static int __init ahci_init(void)