aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/moxa.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 9eb8fa6dd168..2899beafeb0f 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -102,18 +102,12 @@ static struct moxa_isa_board_conf moxa_isa_boards[] =
102/* {MOXA_BOARD_C218_ISA,8,0xDC000}, */ 102/* {MOXA_BOARD_C218_ISA,8,0xDC000}, */
103}; 103};
104 104
105struct moxa_pci_devinfo {
106 ushort busNum;
107 ushort devNum;
108 struct pci_dev *pdev;
109};
110
111struct moxa_board_conf { 105struct moxa_board_conf {
112 int boardType; 106 int boardType;
113 int numPorts; 107 int numPorts;
114 unsigned long baseAddr; 108 unsigned long baseAddr;
115 int busType; 109 int busType;
116 struct moxa_pci_devinfo pciInfo; 110 struct pci_dev *pdev;
117}; 111};
118 112
119static struct moxa_board_conf moxa_boards[MAX_BOARDS]; 113static struct moxa_board_conf moxa_boards[MAX_BOARDS];
@@ -284,11 +278,8 @@ static int moxa_get_PCI_conf(struct pci_dev *p, int board_type,
284 break; 278 break;
285 } 279 }
286 board->busType = MOXA_BUS_TYPE_PCI; 280 board->busType = MOXA_BUS_TYPE_PCI;
287 board->pciInfo.busNum = p->bus->number;
288 board->pciInfo.devNum = p->devfn >> 3;
289 board->pciInfo.pdev = p;
290 /* don't lose the reference in the next pci_get_device iteration */ 281 /* don't lose the reference in the next pci_get_device iteration */
291 pci_dev_get(p); 282 board->pdev = pci_dev_get(p);
292 283
293 return (0); 284 return (0);
294} 285}
@@ -437,7 +428,7 @@ static void __exit moxa_exit(void)
437 if (moxaBaseAddr[i]) 428 if (moxaBaseAddr[i])
438 iounmap(moxaBaseAddr[i]); 429 iounmap(moxaBaseAddr[i]);
439 if (moxa_boards[i].busType == MOXA_BUS_TYPE_PCI) 430 if (moxa_boards[i].busType == MOXA_BUS_TYPE_PCI)
440 pci_dev_put(moxa_boards[i].pciInfo.pdev); 431 pci_dev_put(moxa_boards[i].pdev);
441 } 432 }
442 433
443 if (verbose) 434 if (verbose)