diff options
Diffstat (limited to 'drivers/tty/moxa.c')
-rw-r--r-- | drivers/tty/moxa.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 56e616b..f9d2850 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -895,6 +895,8 @@ static int moxa_init_board(struct moxa_board_conf *brd, struct device *dev) return 0; err_free: + for (i = 0; i < MAX_PORTS_PER_BOARD; i++) + tty_port_destroy(&brd->ports[i].port); kfree(brd->ports); err: return ret; @@ -919,6 +921,8 @@ static void moxa_board_deinit(struct moxa_board_conf *brd) tty_kref_put(tty); } } + for (a = 0; a < MAX_PORTS_PER_BOARD; a++) + tty_port_destroy(&brd->ports[a].port); while (1) { opened = 0; for (a = 0; a < brd->numPorts; a++) @@ -941,7 +945,7 @@ static void moxa_board_deinit(struct moxa_board_conf *brd) } #ifdef CONFIG_PCI -static int __devinit moxa_pci_probe(struct pci_dev *pdev, +static int moxa_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { struct moxa_board_conf *board; @@ -1016,7 +1020,7 @@ err: return retval; } -static void __devexit moxa_pci_remove(struct pci_dev *pdev) +static void moxa_pci_remove(struct pci_dev *pdev) { struct moxa_board_conf *brd = pci_get_drvdata(pdev); @@ -1029,7 +1033,7 @@ static struct pci_driver moxa_pci_driver = { .name = "moxa", .id_table = moxa_pcibrds, .probe = moxa_pci_probe, - .remove = __devexit_p(moxa_pci_remove) + .remove = moxa_pci_remove }; #endif /* CONFIG_PCI */ @@ -1370,7 +1374,7 @@ static void moxa_new_dcdstate(struct moxa_port *p, u8 dcd) p->DCDState = dcd; spin_unlock_irqrestore(&p->port.lock, flags); tty = tty_port_tty_get(&p->port); - if (tty && C_CLOCAL(tty) && !dcd) + if (tty && !C_CLOCAL(tty) && !dcd) tty_hangup(tty); tty_kref_put(tty); } |