]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: mpt: Move scsi_remove_host() out of mptscsih_remove_host()
authorHannes Reinecke <hare@suse.de>
Mon, 24 Apr 2017 09:22:32 +0000 (11:22 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 24 Apr 2017 22:21:17 +0000 (18:21 -0400)
Commit c5ce0abeb628 ("scsi: sas: move scsi_remove_host call...")  moved
the call to scsi_remove_host() into sas_remove_host(), but forgot to
modify the mpt drivers.

Fixes: c5ce0abeb628 ("scsi: sas: move scsi_remove_host call into sas_remove_host")
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/message/fusion/mptfc.c
drivers/message/fusion/mptscsih.c
drivers/message/fusion/mptspi.c

index 98eafae785762ea73329f1f794784bc0e1ecbc64..d065062240bce109c2e177bb76c61c21ce47d11e 100644 (file)
@@ -1329,7 +1329,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                                        WQ_MEM_RECLAIM);
        if (!ioc->fc_rescan_work_q) {
                error = -ENOMEM;
-               goto out_mptfc_probe;
+               goto out_mptfc_host;
        }
 
        /*
@@ -1351,6 +1351,9 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
        return 0;
 
+out_mptfc_host:
+       scsi_remove_host(sh);
+
 out_mptfc_probe:
 
        mptscsih_remove(pdev);
@@ -1530,6 +1533,8 @@ static void mptfc_remove(struct pci_dev *pdev)
                }
        }
 
+       scsi_remove_host(ioc->sh);
+
        mptscsih_remove(pdev);
 }
 
index 08a807d6a44f6a7ab2f05fbef4aefa453a62238f..6ba07c7feb92b37f7cb94a3b0cd45aa52d3e2435 100644 (file)
@@ -1176,8 +1176,6 @@ mptscsih_remove(struct pci_dev *pdev)
        MPT_SCSI_HOST           *hd;
        int sz1;
 
-       scsi_remove_host(host);
-
        if((hd = shost_priv(host)) == NULL)
                return;
 
index 031e088edb5e7a83b3a15f9190c8b193299f1f1b..9a336a161d9f249139926d613a7a1d7794532d5f 100644 (file)
@@ -1548,11 +1548,19 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        return error;
 }
 
+static void mptspi_remove(struct pci_dev *pdev)
+{
+       MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
+
+       scsi_remove_host(ioc->sh);
+       mptscsih_remove(pdev);
+}
+
 static struct pci_driver mptspi_driver = {
        .name           = "mptspi",
        .id_table       = mptspi_pci_table,
        .probe          = mptspi_probe,
-       .remove         = mptscsih_remove,
+       .remove         = mptspi_remove,
        .shutdown       = mptscsih_shutdown,
 #ifdef CONFIG_PM
        .suspend        = mptscsih_suspend,