]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
SCSI: remove unnecessary pci_set_drvdata()
authorJingoo Han <jg1.han@samsung.com>
Tue, 24 Sep 2013 01:16:20 +0000 (10:16 +0900)
committerJiri Kosina <jkosina@suse.cz>
Mon, 14 Oct 2013 13:26:04 +0000 (15:26 +0200)
Since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(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: Jingoo Han <jg1.han@samsung.com>
Cc: James Bottomley <JBottomley@parallels.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
21 files changed:
drivers/scsi/arcmsr/arcmsr_hba.c
drivers/scsi/atp870u.c
drivers/scsi/bfa/bfad.c
drivers/scsi/csiostor/csio_init.c
drivers/scsi/dc395x.c
drivers/scsi/fnic/fnic_main.c
drivers/scsi/gdth.c
drivers/scsi/hpsa.c
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/megaraid/megaraid_mbox.c
drivers/scsi/megaraid/megaraid_sas_base.c
drivers/scsi/mvsas/mv_init.c
drivers/scsi/mvumi.c
drivers/scsi/pm8001/pm8001_init.c
drivers/scsi/pmcraid.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla4xxx/ql4_os.c
drivers/scsi/stex.c
drivers/scsi/tmscsim.c
drivers/scsi/ufs/ufshcd-pci.c
drivers/scsi/vmw_pvscsi.c

index 33c52bc2c7b461033b8845e7e538f072f9ab671f..97fd450aff09315194233e7a8ea1f06b566248ef 100644 (file)
@@ -1035,7 +1035,6 @@ static void arcmsr_remove(struct pci_dev *pdev)
        pci_release_regions(pdev);
        scsi_host_put(host);
        pci_disable_device(pdev);
-       pci_set_drvdata(pdev, NULL);
 }
 
 static void arcmsr_shutdown(struct pci_dev *pdev)
index 15a629d8ed081efe1e5b9e13160703c3d2f8fe6e..a795d81ef8750881aa55cf47c5558a5cdb7da175 100644 (file)
@@ -3144,8 +3144,6 @@ static void atp870u_remove (struct pci_dev *pdev)
        atp870u_free_tables(pshost);
        printk(KERN_INFO "scsi_host_put : %p\n",pshost);
        scsi_host_put(pshost);
-       printk(KERN_INFO "pci_set_drvdata : %p\n",pdev);
-       pci_set_drvdata(pdev, NULL);    
 }
 MODULE_LICENSE("GPL");
 
index f8ca7becacca15477dd04912acf4ccd11df948fc..2e6e3ac2d41bc39129da559e313d12674868da9c 100644 (file)
@@ -833,7 +833,6 @@ bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad)
        /* Disable PCIE Advanced Error Recovery (AER) */
        pci_disable_pcie_error_reporting(pdev);
        pci_disable_device(pdev);
-       pci_set_drvdata(pdev, NULL);
 }
 
 bfa_status_t
index 00346fe939d554b5d089980718cd2fac1492ba41..1aafc331ee63a1a2d9380ffd53710da3466bbf96 100644 (file)
@@ -1010,7 +1010,6 @@ static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        csio_hw_stop(hw);
        spin_unlock_irq(&hw->lock);
        csio_lnodes_unblock_request(hw);
-       pci_set_drvdata(hw->pdev, NULL);
        csio_lnodes_exit(hw, 0);
        csio_hw_free(hw);
 err_pci_exit:
@@ -1044,7 +1043,6 @@ static void csio_remove_one(struct pci_dev *pdev)
 
        csio_lnodes_exit(hw, 0);
        csio_hw_free(hw);
-       pci_set_drvdata(pdev, NULL);
        csio_pci_exit(pdev, &bars);
 }
 
index 694e13c45dfd8362a814dd5626b18c5f04559081..a726187abe5c522c1aea8275542c6a0ad853afd5 100644 (file)
@@ -4859,7 +4859,6 @@ static void dc395x_remove_one(struct pci_dev *dev)
        adapter_uninit(acb);
        pci_disable_device(dev);
        scsi_host_put(scsi_host);
-       pci_set_drvdata(dev, NULL);
 }
 
 
index 42e15ee6e1bb73fceac4bd8aaf8ded5ad06ecf1e..d08dc12082c95e6befeaa273ae1d110600c68420 100644 (file)
@@ -877,7 +877,6 @@ static void fnic_remove(struct pci_dev *pdev)
        fnic_iounmap(fnic);
        pci_release_regions(pdev);
        pci_disable_device(pdev);
-       pci_set_drvdata(pdev, NULL);
        scsi_host_put(lp->host);
 }
 
index 6d55b4e7e7923121d58535ab1a7ff83c50298c8c..ee4fa40a50b131597a3e1b6960bffc17191f2d03 100644 (file)
@@ -594,8 +594,6 @@ static void gdth_pci_remove_one(struct pci_dev *pdev)
 {
        gdth_ha_str *ha = pci_get_drvdata(pdev);
 
-       pci_set_drvdata(pdev, NULL);
-
        list_del(&ha->list);
        gdth_remove_one(ha);
 
index fac8cf5832ddce5bf0fe182570f17e8dbdb6899b..a4320bcc40f2b3d176c9515a99a4b261a6d1c97d 100644 (file)
@@ -4994,7 +4994,6 @@ static void hpsa_remove_one(struct pci_dev *pdev)
        kfree(h->hba_inquiry_data);
        pci_disable_device(pdev);
        pci_release_regions(pdev);
-       pci_set_drvdata(pdev, NULL);
        kfree(h);
 }
 
index 501147c4a147233be1ee8a1b2a0ff0b118bf5751..c1fca8df6355e28fa6056616dbc52ba66290edb7 100644 (file)
@@ -4581,8 +4581,6 @@ lpfc_disable_pci_dev(struct lpfc_hba *phba)
        /* Release PCI resource and disable PCI device */
        pci_release_selected_regions(pdev, bars);
        pci_disable_device(pdev);
-       /* Null out PCI private reference to driver */
-       pci_set_drvdata(pdev, NULL);
 
        return;
 }
@@ -9421,7 +9419,6 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev)
        /* Disable interrupt */
        lpfc_sli_disable_intr(phba);
 
-       pci_set_drvdata(pdev, NULL);
        scsi_host_put(shost);
 
        /*
index 515c9629e9fedf0679257a762b553045858070c1..d1a4b82836ea6936f55504e33bcaabb5db9adbee 100644 (file)
@@ -534,7 +534,6 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        return 0;
 
 out_cmm_unreg:
-       pci_set_drvdata(pdev, NULL);
        megaraid_cmm_unregister(adapter);
 out_fini_mbox:
        megaraid_fini_mbox(adapter);
@@ -594,11 +593,6 @@ megaraid_detach_one(struct pci_dev *pdev)
        // detach from the IO sub-system
        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
        //
        // FIXME: this must return success or failure for conditions if there
index 1f0ca68409d43a09ae24bd98a1703d34ec2ba2cc..fdd13ef8124f1ce6a5226efd0085187719978e51 100644 (file)
@@ -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.max_index--;
 
-       pci_set_drvdata(pdev, NULL);
        instance->instancet->disable_intr(instance);
        if (instance->msix_vectors)
                for (i = 0 ; i < instance->msix_vectors; i++)
@@ -4679,8 +4678,6 @@ static void megasas_detach_one(struct pci_dev *pdev)
                }
        }
 
-       pci_set_drvdata(instance->pdev, NULL);
-
        instance->instancet->disable_intr(instance);
 
        if (instance->msix_vectors)
@@ -4722,8 +4719,6 @@ static void megasas_detach_one(struct pci_dev *pdev)
                                instance->evt_detail, instance->evt_detail_h);
        scsi_host_put(host);
 
-       pci_set_drvdata(pdev, NULL);
-
        pci_disable_device(pdev);
 
        return;
index 7b7381d7671fdc9cfeecdf3c256984b0261d3116..5ff978be249d22b37df66601787cceca92933047 100644 (file)
@@ -657,7 +657,6 @@ static void mvs_pci_remove(struct pci_dev *pdev)
        tasklet_kill(&((struct mvs_prv_info *)sha->lldd_ha)->mv_tasklet);
 #endif
 
-       pci_set_drvdata(pdev, NULL);
        sas_unregister_ha(sha);
        sas_remove_host(mvi->shost);
        scsi_remove_host(mvi->shost);
index c3601b57a80c796cd32aebeb3c00f3d94e89b06f..edbee8dc62c9ab546b5340ca06cbef62ba4cecf3 100644 (file)
@@ -2583,7 +2583,6 @@ static int mvumi_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        return 0;
 
 fail_io_attach:
-       pci_set_drvdata(pdev, NULL);
        mhba->instancet->disable_intr(mhba);
        free_irq(mhba->pdev->irq, mhba);
 fail_init_irq:
@@ -2618,7 +2617,6 @@ static void mvumi_detach_one(struct pci_dev *pdev)
        free_irq(mhba->pdev->irq, mhba);
        mvumi_release_fw(mhba);
        scsi_host_put(host);
-       pci_set_drvdata(pdev, NULL);
        pci_disable_device(pdev);
        dev_dbg(&pdev->dev, "driver is removed!\n");
 }
index f7c189606b8479b3626bcbfe621dbb953e5ee02e..0dba7c7856ab2bcfd013f6d44afe0c8ea0e5505e 100644 (file)
@@ -873,7 +873,6 @@ static void pm8001_pci_remove(struct pci_dev *pdev)
        struct pm8001_hba_info *pm8001_ha;
        int i;
        pm8001_ha = sha->lldd_ha;
-       pci_set_drvdata(pdev, NULL);
        sas_unregister_ha(sha);
        sas_remove_host(pm8001_ha->shost);
        list_del(&pm8001_ha->list);
index 1eb7b0280a45447fc1855ce0a653488cf1591002..e43db7742047aca836fab57c61b1530740f6d383 100644 (file)
@@ -6049,7 +6049,6 @@ static int pmcraid_probe(struct pci_dev *pdev,
 
 out_disable_device:
        atomic_dec(&pmcraid_adapter_count);
-       pci_set_drvdata(pdev, NULL);
        pci_disable_device(pdev);
        return -ENODEV;
 }
index 9f01bbbf3a26c9138a9f457fa9af999fa6572b09..1db4819261cd802f75c6b7a50b523540006b4fe0 100644 (file)
@@ -3183,7 +3183,6 @@ qla2x00_remove_one(struct pci_dev *pdev)
        pci_disable_pcie_error_reporting(pdev);
 
        pci_disable_device(pdev);
-       pci_set_drvdata(pdev, NULL);
 }
 
 static void
index f8a0a26a3cd4bcdcd236c078a23821e2de7666a1..1be6cefc390b9933432de61466d2d029e4f232ae 100644 (file)
@@ -7400,7 +7400,6 @@ static void qla4xxx_remove_adapter(struct pci_dev *pdev)
 
        pci_disable_pcie_error_reporting(pdev);
        pci_disable_device(pdev);
-       pci_set_drvdata(pdev, NULL);
 }
 
 /**
index 325c31caa6e0dd98dbce0724b968a7ee5efcba69..1aa4befcfbd0120b11df14a4b0f918b00f5be72d 100644 (file)
@@ -1790,8 +1790,6 @@ static void stex_remove(struct pci_dev *pdev)
 
        scsi_remove_host(hba->host);
 
-       pci_set_drvdata(pdev, NULL);
-
        stex_hba_stop(hba);
 
        stex_hba_free(hba);
index 9327f5fcec4e85c9a8d8606bd9347b7d0702709e..b06a1dea8818c8bec389829b2b795a8d84ee2d19 100644 (file)
@@ -2553,7 +2553,6 @@ static void dc390_remove_one(struct pci_dev *dev)
 
        pci_disable_device(dev);
        scsi_host_put(scsi_host);
-       pci_set_drvdata(dev, NULL);
 }
 
 static struct pci_device_id tmscsim_pci_tbl[] = {
index a823cf44e9494bdc506a2e4b86d7edb190ea76dc..8b9531204c2bb7ee570fb3d504a59803765a4ba6 100644 (file)
@@ -132,7 +132,6 @@ static void ufshcd_pci_remove(struct pci_dev *pdev)
        pm_runtime_forbid(&pdev->dev);
        pm_runtime_get_noresume(&pdev->dev);
        ufshcd_remove(hba);
-       pci_set_drvdata(pdev, NULL);
 }
 
 /**
index 3bfaa66fa0d16d31610ee33ef41c9cce10031f1a..b9755ec0e8123cdd7a3479659fb2111924dc3056 100644 (file)
@@ -1405,7 +1405,6 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 out_free_host:
        scsi_host_put(host);
 out_disable_device:
-       pci_set_drvdata(pdev, NULL);
        pci_disable_device(pdev);
 
        return error;
@@ -1445,7 +1444,6 @@ static void pvscsi_remove(struct pci_dev *pdev)
 
        scsi_host_put(host);
 
-       pci_set_drvdata(pdev, NULL);
        pci_disable_device(pdev);
 }