diff options
Diffstat (limited to 'drivers/char/mxser.c')
-rw-r--r-- | drivers/char/mxser.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 4204746f1590..2dc49be144e6 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c | |||
@@ -515,6 +515,7 @@ static void __exit mxser_module_exit(void) | |||
515 | if (pdev != NULL) { /* PCI */ | 515 | if (pdev != NULL) { /* PCI */ |
516 | release_region(pci_resource_start(pdev, 2), pci_resource_len(pdev, 2)); | 516 | release_region(pci_resource_start(pdev, 2), pci_resource_len(pdev, 2)); |
517 | release_region(pci_resource_start(pdev, 3), pci_resource_len(pdev, 3)); | 517 | release_region(pci_resource_start(pdev, 3), pci_resource_len(pdev, 3)); |
518 | pci_dev_put(pdev); | ||
518 | } else { | 519 | } else { |
519 | release_region(mxsercfg[i].ioaddr[0], 8 * mxsercfg[i].ports); | 520 | release_region(mxsercfg[i].ioaddr[0], 8 * mxsercfg[i].ports); |
520 | release_region(mxsercfg[i].vector, 1); | 521 | release_region(mxsercfg[i].vector, 1); |
@@ -839,9 +840,9 @@ static int mxser_init(void) | |||
839 | index = 0; | 840 | index = 0; |
840 | b = 0; | 841 | b = 0; |
841 | while (b < n) { | 842 | while (b < n) { |
842 | pdev = pci_find_device(mxser_pcibrds[b].vendor, | 843 | pdev = pci_get_device(mxser_pcibrds[b].vendor, |
843 | mxser_pcibrds[b].device, pdev); | 844 | mxser_pcibrds[b].device, pdev); |
844 | if (pdev == NULL) { | 845 | if (pdev == NULL) { |
845 | b++; | 846 | b++; |
846 | continue; | 847 | continue; |
847 | } | 848 | } |
@@ -893,6 +894,9 @@ static int mxser_init(void) | |||
893 | if (mxser_initbrd(m, &hwconf) < 0) | 894 | if (mxser_initbrd(m, &hwconf) < 0) |
894 | continue; | 895 | continue; |
895 | m++; | 896 | m++; |
897 | /* Keep an extra reference if we succeeded. It will | ||
898 | be returned at unload time */ | ||
899 | pci_dev_get(pdev); | ||
896 | } | 900 | } |
897 | } | 901 | } |
898 | #endif | 902 | #endif |