aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index e17bb900aad..3205f7488d1 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1892,10 +1892,11 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1892 int error = -ENODEV, retval; 1892 int error = -ENODEV, retval;
1893 int i, hbq_count; 1893 int i, hbq_count;
1894 uint16_t iotag; 1894 uint16_t iotag;
1895 int bars = pci_select_bars(pdev, IORESOURCE_MEM);
1895 1896
1896 if (pci_enable_device(pdev)) 1897 if (pci_enable_device_bars(pdev, bars))
1897 goto out; 1898 goto out;
1898 if (pci_request_regions(pdev, LPFC_DRIVER_NAME)) 1899 if (pci_request_selected_regions(pdev, bars, LPFC_DRIVER_NAME))
1899 goto out_disable_device; 1900 goto out_disable_device;
1900 1901
1901 phba = kzalloc(sizeof (struct lpfc_hba), GFP_KERNEL); 1902 phba = kzalloc(sizeof (struct lpfc_hba), GFP_KERNEL);
@@ -2167,7 +2168,7 @@ out_idr_remove:
2167out_free_phba: 2168out_free_phba:
2168 kfree(phba); 2169 kfree(phba);
2169out_release_regions: 2170out_release_regions:
2170 pci_release_regions(pdev); 2171 pci_release_selected_regions(pdev, bars);
2171out_disable_device: 2172out_disable_device:
2172 pci_disable_device(pdev); 2173 pci_disable_device(pdev);
2173out: 2174out:
@@ -2183,6 +2184,8 @@ lpfc_pci_remove_one(struct pci_dev *pdev)
2183 struct Scsi_Host *shost = pci_get_drvdata(pdev); 2184 struct Scsi_Host *shost = pci_get_drvdata(pdev);
2184 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; 2185 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
2185 struct lpfc_hba *phba = vport->phba; 2186 struct lpfc_hba *phba = vport->phba;
2187 int bars = pci_select_bars(pdev, IORESOURCE_MEM);
2188
2186 spin_lock_irq(&phba->hbalock); 2189 spin_lock_irq(&phba->hbalock);
2187 vport->load_flag |= FC_UNLOADING; 2190 vport->load_flag |= FC_UNLOADING;
2188 spin_unlock_irq(&phba->hbalock); 2191 spin_unlock_irq(&phba->hbalock);
@@ -2241,7 +2244,7 @@ lpfc_pci_remove_one(struct pci_dev *pdev)
2241 2244
2242 kfree(phba); 2245 kfree(phba);
2243 2246
2244 pci_release_regions(pdev); 2247 pci_release_selected_regions(pdev, bars);
2245 pci_disable_device(pdev); 2248 pci_disable_device(pdev);
2246} 2249}
2247 2250