提交 08b7e107 编写于 作者: J Jingoo Han 提交者: Jiri Kosina

SCSI: remove unnecessary pci_set_drvdata()

Since commit 0998d063
(device-core: Ensure drvdata = NULL when no driver is bound),
the driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: NJingoo Han <jg1.han@samsung.com>
Cc: James Bottomley <JBottomley@parallels.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 6d3be300
...@@ -1035,7 +1035,6 @@ static void arcmsr_remove(struct pci_dev *pdev) ...@@ -1035,7 +1035,6 @@ static void arcmsr_remove(struct pci_dev *pdev)
pci_release_regions(pdev); pci_release_regions(pdev);
scsi_host_put(host); scsi_host_put(host);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
} }
static void arcmsr_shutdown(struct pci_dev *pdev) static void arcmsr_shutdown(struct pci_dev *pdev)
......
...@@ -3144,8 +3144,6 @@ static void atp870u_remove (struct pci_dev *pdev) ...@@ -3144,8 +3144,6 @@ static void atp870u_remove (struct pci_dev *pdev)
atp870u_free_tables(pshost); atp870u_free_tables(pshost);
printk(KERN_INFO "scsi_host_put : %p\n",pshost); printk(KERN_INFO "scsi_host_put : %p\n",pshost);
scsi_host_put(pshost); scsi_host_put(pshost);
printk(KERN_INFO "pci_set_drvdata : %p\n",pdev);
pci_set_drvdata(pdev, NULL);
} }
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
......
...@@ -833,7 +833,6 @@ bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad) ...@@ -833,7 +833,6 @@ bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad)
/* Disable PCIE Advanced Error Recovery (AER) */ /* Disable PCIE Advanced Error Recovery (AER) */
pci_disable_pcie_error_reporting(pdev); pci_disable_pcie_error_reporting(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
} }
bfa_status_t bfa_status_t
......
...@@ -1010,7 +1010,6 @@ static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1010,7 +1010,6 @@ static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
csio_hw_stop(hw); csio_hw_stop(hw);
spin_unlock_irq(&hw->lock); spin_unlock_irq(&hw->lock);
csio_lnodes_unblock_request(hw); csio_lnodes_unblock_request(hw);
pci_set_drvdata(hw->pdev, NULL);
csio_lnodes_exit(hw, 0); csio_lnodes_exit(hw, 0);
csio_hw_free(hw); csio_hw_free(hw);
err_pci_exit: err_pci_exit:
...@@ -1044,7 +1043,6 @@ static void csio_remove_one(struct pci_dev *pdev) ...@@ -1044,7 +1043,6 @@ static void csio_remove_one(struct pci_dev *pdev)
csio_lnodes_exit(hw, 0); csio_lnodes_exit(hw, 0);
csio_hw_free(hw); csio_hw_free(hw);
pci_set_drvdata(pdev, NULL);
csio_pci_exit(pdev, &bars); csio_pci_exit(pdev, &bars);
} }
......
...@@ -4859,7 +4859,6 @@ static void dc395x_remove_one(struct pci_dev *dev) ...@@ -4859,7 +4859,6 @@ static void dc395x_remove_one(struct pci_dev *dev)
adapter_uninit(acb); adapter_uninit(acb);
pci_disable_device(dev); pci_disable_device(dev);
scsi_host_put(scsi_host); scsi_host_put(scsi_host);
pci_set_drvdata(dev, NULL);
} }
......
...@@ -877,7 +877,6 @@ static void fnic_remove(struct pci_dev *pdev) ...@@ -877,7 +877,6 @@ static void fnic_remove(struct pci_dev *pdev)
fnic_iounmap(fnic); fnic_iounmap(fnic);
pci_release_regions(pdev); pci_release_regions(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
scsi_host_put(lp->host); scsi_host_put(lp->host);
} }
......
...@@ -594,8 +594,6 @@ static void gdth_pci_remove_one(struct pci_dev *pdev) ...@@ -594,8 +594,6 @@ static void gdth_pci_remove_one(struct pci_dev *pdev)
{ {
gdth_ha_str *ha = pci_get_drvdata(pdev); gdth_ha_str *ha = pci_get_drvdata(pdev);
pci_set_drvdata(pdev, NULL);
list_del(&ha->list); list_del(&ha->list);
gdth_remove_one(ha); gdth_remove_one(ha);
......
...@@ -4994,7 +4994,6 @@ static void hpsa_remove_one(struct pci_dev *pdev) ...@@ -4994,7 +4994,6 @@ static void hpsa_remove_one(struct pci_dev *pdev)
kfree(h->hba_inquiry_data); kfree(h->hba_inquiry_data);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_release_regions(pdev); pci_release_regions(pdev);
pci_set_drvdata(pdev, NULL);
kfree(h); kfree(h);
} }
......
...@@ -4581,8 +4581,6 @@ lpfc_disable_pci_dev(struct lpfc_hba *phba) ...@@ -4581,8 +4581,6 @@ lpfc_disable_pci_dev(struct lpfc_hba *phba)
/* Release PCI resource and disable PCI device */ /* Release PCI resource and disable PCI device */
pci_release_selected_regions(pdev, bars); pci_release_selected_regions(pdev, bars);
pci_disable_device(pdev); pci_disable_device(pdev);
/* Null out PCI private reference to driver */
pci_set_drvdata(pdev, NULL);
return; return;
} }
...@@ -9421,7 +9419,6 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev) ...@@ -9421,7 +9419,6 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev)
/* Disable interrupt */ /* Disable interrupt */
lpfc_sli_disable_intr(phba); lpfc_sli_disable_intr(phba);
pci_set_drvdata(pdev, NULL);
scsi_host_put(shost); scsi_host_put(shost);
/* /*
......
...@@ -534,7 +534,6 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -534,7 +534,6 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
return 0; return 0;
out_cmm_unreg: out_cmm_unreg:
pci_set_drvdata(pdev, NULL);
megaraid_cmm_unregister(adapter); megaraid_cmm_unregister(adapter);
out_fini_mbox: out_fini_mbox:
megaraid_fini_mbox(adapter); megaraid_fini_mbox(adapter);
...@@ -594,11 +593,6 @@ megaraid_detach_one(struct pci_dev *pdev) ...@@ -594,11 +593,6 @@ megaraid_detach_one(struct pci_dev *pdev)
// detach from the IO sub-system // detach from the IO sub-system
megaraid_io_detach(adapter); megaraid_io_detach(adapter);
// reset the device state in the PCI structure. We check this
// condition when we enter here. If the device state is NULL,
// that would mean the device has already been removed
pci_set_drvdata(pdev, NULL);
// Unregister from common management module // Unregister from common management module
// //
// FIXME: this must return success or failure for conditions if there // FIXME: this must return success or failure for conditions if there
......
...@@ -4323,7 +4323,6 @@ static int megasas_probe_one(struct pci_dev *pdev, ...@@ -4323,7 +4323,6 @@ static int megasas_probe_one(struct pci_dev *pdev,
megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL; megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL;
megasas_mgmt_info.max_index--; megasas_mgmt_info.max_index--;
pci_set_drvdata(pdev, NULL);
instance->instancet->disable_intr(instance); instance->instancet->disable_intr(instance);
if (instance->msix_vectors) if (instance->msix_vectors)
for (i = 0 ; i < instance->msix_vectors; i++) for (i = 0 ; i < instance->msix_vectors; i++)
...@@ -4679,8 +4678,6 @@ static void megasas_detach_one(struct pci_dev *pdev) ...@@ -4679,8 +4678,6 @@ static void megasas_detach_one(struct pci_dev *pdev)
} }
} }
pci_set_drvdata(instance->pdev, NULL);
instance->instancet->disable_intr(instance); instance->instancet->disable_intr(instance);
if (instance->msix_vectors) if (instance->msix_vectors)
...@@ -4722,8 +4719,6 @@ static void megasas_detach_one(struct pci_dev *pdev) ...@@ -4722,8 +4719,6 @@ static void megasas_detach_one(struct pci_dev *pdev)
instance->evt_detail, instance->evt_detail_h); instance->evt_detail, instance->evt_detail_h);
scsi_host_put(host); scsi_host_put(host);
pci_set_drvdata(pdev, NULL);
pci_disable_device(pdev); pci_disable_device(pdev);
return; return;
......
...@@ -657,7 +657,6 @@ static void mvs_pci_remove(struct pci_dev *pdev) ...@@ -657,7 +657,6 @@ static void mvs_pci_remove(struct pci_dev *pdev)
tasklet_kill(&((struct mvs_prv_info *)sha->lldd_ha)->mv_tasklet); tasklet_kill(&((struct mvs_prv_info *)sha->lldd_ha)->mv_tasklet);
#endif #endif
pci_set_drvdata(pdev, NULL);
sas_unregister_ha(sha); sas_unregister_ha(sha);
sas_remove_host(mvi->shost); sas_remove_host(mvi->shost);
scsi_remove_host(mvi->shost); scsi_remove_host(mvi->shost);
......
...@@ -2583,7 +2583,6 @@ static int mvumi_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2583,7 +2583,6 @@ static int mvumi_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
return 0; return 0;
fail_io_attach: fail_io_attach:
pci_set_drvdata(pdev, NULL);
mhba->instancet->disable_intr(mhba); mhba->instancet->disable_intr(mhba);
free_irq(mhba->pdev->irq, mhba); free_irq(mhba->pdev->irq, mhba);
fail_init_irq: fail_init_irq:
...@@ -2618,7 +2617,6 @@ static void mvumi_detach_one(struct pci_dev *pdev) ...@@ -2618,7 +2617,6 @@ static void mvumi_detach_one(struct pci_dev *pdev)
free_irq(mhba->pdev->irq, mhba); free_irq(mhba->pdev->irq, mhba);
mvumi_release_fw(mhba); mvumi_release_fw(mhba);
scsi_host_put(host); scsi_host_put(host);
pci_set_drvdata(pdev, NULL);
pci_disable_device(pdev); pci_disable_device(pdev);
dev_dbg(&pdev->dev, "driver is removed!\n"); dev_dbg(&pdev->dev, "driver is removed!\n");
} }
......
...@@ -873,7 +873,6 @@ static void pm8001_pci_remove(struct pci_dev *pdev) ...@@ -873,7 +873,6 @@ static void pm8001_pci_remove(struct pci_dev *pdev)
struct pm8001_hba_info *pm8001_ha; struct pm8001_hba_info *pm8001_ha;
int i; int i;
pm8001_ha = sha->lldd_ha; pm8001_ha = sha->lldd_ha;
pci_set_drvdata(pdev, NULL);
sas_unregister_ha(sha); sas_unregister_ha(sha);
sas_remove_host(pm8001_ha->shost); sas_remove_host(pm8001_ha->shost);
list_del(&pm8001_ha->list); list_del(&pm8001_ha->list);
......
...@@ -6049,7 +6049,6 @@ static int pmcraid_probe(struct pci_dev *pdev, ...@@ -6049,7 +6049,6 @@ static int pmcraid_probe(struct pci_dev *pdev,
out_disable_device: out_disable_device:
atomic_dec(&pmcraid_adapter_count); atomic_dec(&pmcraid_adapter_count);
pci_set_drvdata(pdev, NULL);
pci_disable_device(pdev); pci_disable_device(pdev);
return -ENODEV; return -ENODEV;
} }
......
...@@ -3183,7 +3183,6 @@ qla2x00_remove_one(struct pci_dev *pdev) ...@@ -3183,7 +3183,6 @@ qla2x00_remove_one(struct pci_dev *pdev)
pci_disable_pcie_error_reporting(pdev); pci_disable_pcie_error_reporting(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
} }
static void static void
......
...@@ -7400,7 +7400,6 @@ static void qla4xxx_remove_adapter(struct pci_dev *pdev) ...@@ -7400,7 +7400,6 @@ static void qla4xxx_remove_adapter(struct pci_dev *pdev)
pci_disable_pcie_error_reporting(pdev); pci_disable_pcie_error_reporting(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
} }
/** /**
......
...@@ -1790,8 +1790,6 @@ static void stex_remove(struct pci_dev *pdev) ...@@ -1790,8 +1790,6 @@ static void stex_remove(struct pci_dev *pdev)
scsi_remove_host(hba->host); scsi_remove_host(hba->host);
pci_set_drvdata(pdev, NULL);
stex_hba_stop(hba); stex_hba_stop(hba);
stex_hba_free(hba); stex_hba_free(hba);
......
...@@ -2553,7 +2553,6 @@ static void dc390_remove_one(struct pci_dev *dev) ...@@ -2553,7 +2553,6 @@ static void dc390_remove_one(struct pci_dev *dev)
pci_disable_device(dev); pci_disable_device(dev);
scsi_host_put(scsi_host); scsi_host_put(scsi_host);
pci_set_drvdata(dev, NULL);
} }
static struct pci_device_id tmscsim_pci_tbl[] = { static struct pci_device_id tmscsim_pci_tbl[] = {
......
...@@ -132,7 +132,6 @@ static void ufshcd_pci_remove(struct pci_dev *pdev) ...@@ -132,7 +132,6 @@ static void ufshcd_pci_remove(struct pci_dev *pdev)
pm_runtime_forbid(&pdev->dev); pm_runtime_forbid(&pdev->dev);
pm_runtime_get_noresume(&pdev->dev); pm_runtime_get_noresume(&pdev->dev);
ufshcd_remove(hba); ufshcd_remove(hba);
pci_set_drvdata(pdev, NULL);
} }
/** /**
......
...@@ -1405,7 +1405,6 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1405,7 +1405,6 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
out_free_host: out_free_host:
scsi_host_put(host); scsi_host_put(host);
out_disable_device: out_disable_device:
pci_set_drvdata(pdev, NULL);
pci_disable_device(pdev); pci_disable_device(pdev);
return error; return error;
...@@ -1445,7 +1444,6 @@ static void pvscsi_remove(struct pci_dev *pdev) ...@@ -1445,7 +1444,6 @@ static void pvscsi_remove(struct pci_dev *pdev)
scsi_host_put(host); scsi_host_put(host);
pci_set_drvdata(pdev, NULL);
pci_disable_device(pdev); pci_disable_device(pdev);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册