diff options
-rw-r--r-- | drivers/char/ip2/ip2main.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c index 7907ae88c2f4..331f447e6228 100644 --- a/drivers/char/ip2/ip2main.c +++ b/drivers/char/ip2/ip2main.c | |||
@@ -436,6 +436,7 @@ cleanup_module(void) | |||
436 | #ifdef CONFIG_PCI | 436 | #ifdef CONFIG_PCI |
437 | if (ip2config.type[i] == PCI && ip2config.pci_dev[i]) { | 437 | if (ip2config.type[i] == PCI && ip2config.pci_dev[i]) { |
438 | pci_disable_device(ip2config.pci_dev[i]); | 438 | pci_disable_device(ip2config.pci_dev[i]); |
439 | pci_dev_put(ip2config.pci_dev[i]); | ||
439 | ip2config.pci_dev[i] = NULL; | 440 | ip2config.pci_dev[i] = NULL; |
440 | } | 441 | } |
441 | #endif | 442 | #endif |
@@ -505,6 +506,7 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) | |||
505 | static int loaded; | 506 | static int loaded; |
506 | i2eBordStrPtr pB = NULL; | 507 | i2eBordStrPtr pB = NULL; |
507 | int rc = -1; | 508 | int rc = -1; |
509 | static struct pci_dev *pci_dev_i = NULL; | ||
508 | 510 | ||
509 | ip2trace (ITRC_NO_PORT, ITRC_INIT, ITRC_ENTER, 0 ); | 511 | ip2trace (ITRC_NO_PORT, ITRC_INIT, ITRC_ENTER, 0 ); |
510 | 512 | ||
@@ -588,8 +590,7 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) | |||
588 | case PCI: | 590 | case PCI: |
589 | #ifdef CONFIG_PCI | 591 | #ifdef CONFIG_PCI |
590 | { | 592 | { |
591 | struct pci_dev *pci_dev_i = NULL; | 593 | pci_dev_i = pci_get_device(PCI_VENDOR_ID_COMPUTONE, |
592 | pci_dev_i = pci_find_device(PCI_VENDOR_ID_COMPUTONE, | ||
593 | PCI_DEVICE_ID_COMPUTONE_IP2EX, pci_dev_i); | 594 | PCI_DEVICE_ID_COMPUTONE_IP2EX, pci_dev_i); |
594 | if (pci_dev_i != NULL) { | 595 | if (pci_dev_i != NULL) { |
595 | unsigned int addr; | 596 | unsigned int addr; |
@@ -600,7 +601,7 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) | |||
600 | break; | 601 | break; |
601 | } | 602 | } |
602 | ip2config.type[i] = PCI; | 603 | ip2config.type[i] = PCI; |
603 | ip2config.pci_dev[i] = pci_dev_i; | 604 | ip2config.pci_dev[i] = pci_dev_get(pci_dev_i); |
604 | status = | 605 | status = |
605 | pci_read_config_dword(pci_dev_i, PCI_BASE_ADDRESS_1, &addr); | 606 | pci_read_config_dword(pci_dev_i, PCI_BASE_ADDRESS_1, &addr); |
606 | if ( addr & 1 ) { | 607 | if ( addr & 1 ) { |
@@ -641,6 +642,9 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) | |||
641 | break; | 642 | break; |
642 | } /* switch */ | 643 | } /* switch */ |
643 | } /* for */ | 644 | } /* for */ |
645 | if (pci_dev_i) | ||
646 | pci_dev_put(pci_dev_i); | ||
647 | |||
644 | for ( i = 0; i < IP2_MAX_BOARDS; ++i ) { | 648 | for ( i = 0; i < IP2_MAX_BOARDS; ++i ) { |
645 | if ( ip2config.addr[i] ) { | 649 | if ( ip2config.addr[i] ) { |
646 | pB = kmalloc( sizeof(i2eBordStr), GFP_KERNEL); | 650 | pB = kmalloc( sizeof(i2eBordStr), GFP_KERNEL); |