diff options
Diffstat (limited to 'drivers/edac/i82875p_edac.c')
-rw-r--r-- | drivers/edac/i82875p_edac.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c index e43bdc43a1bf..ebb037b78758 100644 --- a/drivers/edac/i82875p_edac.c +++ b/drivers/edac/i82875p_edac.c | |||
@@ -182,8 +182,6 @@ static struct pci_dev *mci_pdev; /* init dev: in case that AGP code has | |||
182 | * already registered driver | 182 | * already registered driver |
183 | */ | 183 | */ |
184 | 184 | ||
185 | static int i82875p_registered = 1; | ||
186 | |||
187 | static struct edac_pci_ctl_info *i82875p_pci; | 185 | static struct edac_pci_ctl_info *i82875p_pci; |
188 | 186 | ||
189 | static void i82875p_get_error_info(struct mem_ctl_info *mci, | 187 | static void i82875p_get_error_info(struct mem_ctl_info *mci, |
@@ -295,6 +293,7 @@ static int i82875p_setup_overfl_dev(struct pci_dev *pdev, | |||
295 | "%s(): pci_bus_add_device() Failed\n", | 293 | "%s(): pci_bus_add_device() Failed\n", |
296 | __func__); | 294 | __func__); |
297 | } | 295 | } |
296 | pci_bus_assign_resources(dev->bus); | ||
298 | } | 297 | } |
299 | 298 | ||
300 | *ovrfl_pdev = dev; | 299 | *ovrfl_pdev = dev; |
@@ -409,6 +408,9 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx) | |||
409 | goto fail0; | 408 | goto fail0; |
410 | } | 409 | } |
411 | 410 | ||
411 | /* Keeps mci available after edac_mc_del_mc() till edac_mc_free() */ | ||
412 | kobject_get(&mci->edac_mci_kobj); | ||
413 | |||
412 | debugf3("%s(): init mci\n", __func__); | 414 | debugf3("%s(): init mci\n", __func__); |
413 | mci->dev = &pdev->dev; | 415 | mci->dev = &pdev->dev; |
414 | mci->mtype_cap = MEM_FLAG_DDR; | 416 | mci->mtype_cap = MEM_FLAG_DDR; |
@@ -451,6 +453,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx) | |||
451 | return 0; | 453 | return 0; |
452 | 454 | ||
453 | fail1: | 455 | fail1: |
456 | kobject_put(&mci->edac_mci_kobj); | ||
454 | edac_mc_free(mci); | 457 | edac_mc_free(mci); |
455 | 458 | ||
456 | fail0: | 459 | fail0: |
@@ -578,12 +581,11 @@ static void __exit i82875p_exit(void) | |||
578 | { | 581 | { |
579 | debugf3("%s()\n", __func__); | 582 | debugf3("%s()\n", __func__); |
580 | 583 | ||
584 | i82875p_remove_one(mci_pdev); | ||
585 | pci_dev_put(mci_pdev); | ||
586 | |||
581 | pci_unregister_driver(&i82875p_driver); | 587 | pci_unregister_driver(&i82875p_driver); |
582 | 588 | ||
583 | if (!i82875p_registered) { | ||
584 | i82875p_remove_one(mci_pdev); | ||
585 | pci_dev_put(mci_pdev); | ||
586 | } | ||
587 | } | 589 | } |
588 | 590 | ||
589 | module_init(i82875p_init); | 591 | module_init(i82875p_init); |