Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40104
b: refs/heads/master
c: 86fbf14
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Oct 21, 2006
1 parent d0591e7 commit 885ba42
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b7fc708b568a258595e1fa911b930a75ac07b48
refs/heads/master: 86fbf1486a44a4bce4fdcbe3665a7d8a62ba958a
9 changes: 9 additions & 0 deletions trunk/drivers/char/moxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ static moxa_isa_board_conf moxa_isa_boards[] =
typedef struct _moxa_pci_devinfo {
ushort busNum;
ushort devNum;
struct pci_dev *pdev;
} moxa_pci_devinfo;

typedef struct _moxa_board_conf {
Expand Down Expand Up @@ -324,6 +325,9 @@ static int moxa_get_PCI_conf(struct pci_dev *p, int board_type, moxa_board_conf
board->busType = MOXA_BUS_TYPE_PCI;
board->pciInfo.busNum = p->bus->number;
board->pciInfo.devNum = p->devfn >> 3;
board->pciInfo.pdev = p;
/* don't lose the reference in the next pci_get_device iteration */
pci_dev_get(p);

return (0);
}
Expand Down Expand Up @@ -493,6 +497,11 @@ static void __exit moxa_exit(void)
if (tty_unregister_driver(moxaDriver))
printk("Couldn't unregister MOXA Intellio family serial driver\n");
put_tty_driver(moxaDriver);

for (i = 0; i < MAX_BOARDS; i++)
if (moxa_boards[i].busType == MOXA_BUS_TYPE_PCI)
pci_dev_put(moxa_boards[i].pciInfo.pdev);

if (verbose)
printk("Done\n");
}
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/char/rio/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
** the host.
*/
struct Host {
struct pci_dev *pdev;
unsigned char Type; /* RIO_EISA, RIO_MCA, ... */
unsigned char Ivec; /* POLLED or ivec number */
unsigned char Mode; /* Control stuff */
Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/char/rio/rio_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,10 @@ static int __init rio_init(void)
rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);

fix_rio_pci(pdev);

p->RIOHosts[p->RIONumHosts].pdev = pdev;
pci_dev_get(pdev);

p->RIOLastPCISearch = 0;
p->RIONumHosts++;
found++;
Expand Down Expand Up @@ -1066,6 +1070,9 @@ static int __init rio_init(void)
((readb(&p->RIOHosts[p->RIONumHosts].Unique[1]) & 0xFF) << 8) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[2]) & 0xFF) << 16) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[3]) & 0xFF) << 24);
rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);

p->RIOHosts[p->RIONumHosts].pdev = pdev;
pci_dev_get(pdev);

p->RIOLastPCISearch = 0;
p->RIONumHosts++;
found++;
Expand Down Expand Up @@ -1181,6 +1188,8 @@ static void __exit rio_exit(void)
}
/* It is safe/allowed to del_timer a non-active timer */
del_timer(&hp->timer);
if (hp->Type == RIO_PCI)
pci_dev_put(hp->pdev);
}

if (misc_deregister(&rio_fw_device) < 0) {
Expand Down

0 comments on commit 885ba42

Please sign in to comment.