aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge/qlge_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/qlge/qlge_main.c')
-rw-r--r--drivers/net/qlge/qlge_main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index c30350c8c86a..3d0efea32111 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -3832,11 +3832,14 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
3832 return err; 3832 return err;
3833 } 3833 }
3834 3834
3835 qdev->ndev = ndev;
3836 qdev->pdev = pdev;
3837 pci_set_drvdata(pdev, ndev);
3835 pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); 3838 pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
3836 if (pos <= 0) { 3839 if (pos <= 0) {
3837 dev_err(&pdev->dev, PFX "Cannot find PCI Express capability, " 3840 dev_err(&pdev->dev, PFX "Cannot find PCI Express capability, "
3838 "aborting.\n"); 3841 "aborting.\n");
3839 goto err_out; 3842 return pos;
3840 } else { 3843 } else {
3841 pci_read_config_word(pdev, pos + PCI_EXP_DEVCTL, &val16); 3844 pci_read_config_word(pdev, pos + PCI_EXP_DEVCTL, &val16);
3842 val16 &= ~PCI_EXP_DEVCTL_NOSNOOP_EN; 3845 val16 &= ~PCI_EXP_DEVCTL_NOSNOOP_EN;
@@ -3849,7 +3852,7 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
3849 err = pci_request_regions(pdev, DRV_NAME); 3852 err = pci_request_regions(pdev, DRV_NAME);
3850 if (err) { 3853 if (err) {
3851 dev_err(&pdev->dev, "PCI region request failed.\n"); 3854 dev_err(&pdev->dev, "PCI region request failed.\n");
3852 goto err_out; 3855 return err;
3853 } 3856 }
3854 3857
3855 pci_set_master(pdev); 3858 pci_set_master(pdev);
@@ -3867,7 +3870,6 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
3867 goto err_out; 3870 goto err_out;
3868 } 3871 }
3869 3872
3870 pci_set_drvdata(pdev, ndev);
3871 qdev->reg_base = 3873 qdev->reg_base =
3872 ioremap_nocache(pci_resource_start(pdev, 1), 3874 ioremap_nocache(pci_resource_start(pdev, 1),
3873 pci_resource_len(pdev, 1)); 3875 pci_resource_len(pdev, 1));
@@ -3887,8 +3889,6 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
3887 goto err_out; 3889 goto err_out;
3888 } 3890 }
3889 3891
3890 qdev->ndev = ndev;
3891 qdev->pdev = pdev;
3892 err = ql_get_board_info(qdev); 3892 err = ql_get_board_info(qdev);
3893 if (err) { 3893 if (err) {
3894 dev_err(&pdev->dev, "Register access failed.\n"); 3894 dev_err(&pdev->dev, "Register access failed.\n");