diff options
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/i82875p_edac.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c index 7f909972fecd..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, |
@@ -410,6 +408,9 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx) | |||
410 | goto fail0; | 408 | goto fail0; |
411 | } | 409 | } |
412 | 410 | ||
411 | /* Keeps mci available after edac_mc_del_mc() till edac_mc_free() */ | ||
412 | kobject_get(&mci->edac_mci_kobj); | ||
413 | |||
413 | debugf3("%s(): init mci\n", __func__); | 414 | debugf3("%s(): init mci\n", __func__); |
414 | mci->dev = &pdev->dev; | 415 | mci->dev = &pdev->dev; |
415 | mci->mtype_cap = MEM_FLAG_DDR; | 416 | mci->mtype_cap = MEM_FLAG_DDR; |
@@ -452,6 +453,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx) | |||
452 | return 0; | 453 | return 0; |
453 | 454 | ||
454 | fail1: | 455 | fail1: |
456 | kobject_put(&mci->edac_mci_kobj); | ||
455 | edac_mc_free(mci); | 457 | edac_mc_free(mci); |
456 | 458 | ||
457 | fail0: | 459 | fail0: |
@@ -579,12 +581,11 @@ static void __exit i82875p_exit(void) | |||
579 | { | 581 | { |
580 | debugf3("%s()\n", __func__); | 582 | debugf3("%s()\n", __func__); |
581 | 583 | ||
584 | i82875p_remove_one(mci_pdev); | ||
585 | pci_dev_put(mci_pdev); | ||
586 | |||
582 | pci_unregister_driver(&i82875p_driver); | 587 | pci_unregister_driver(&i82875p_driver); |
583 | 588 | ||
584 | if (!i82875p_registered) { | ||
585 | i82875p_remove_one(mci_pdev); | ||
586 | pci_dev_put(mci_pdev); | ||
587 | } | ||
588 | } | 589 | } |
589 | 590 | ||
590 | module_init(i82875p_init); | 591 | module_init(i82875p_init); |