aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/moxa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/moxa.c')
-rw-r--r--drivers/tty/moxa.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
index 56e616b9109a..f9d28503bdec 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)
895 895
896 return 0; 896 return 0;
897err_free: 897err_free:
898 for (i = 0; i < MAX_PORTS_PER_BOARD; i++)
899 tty_port_destroy(&brd->ports[i].port);
898 kfree(brd->ports); 900 kfree(brd->ports);
899err: 901err:
900 return ret; 902 return ret;
@@ -919,6 +921,8 @@ static void moxa_board_deinit(struct moxa_board_conf *brd)
919 tty_kref_put(tty); 921 tty_kref_put(tty);
920 } 922 }
921 } 923 }
924 for (a = 0; a < MAX_PORTS_PER_BOARD; a++)
925 tty_port_destroy(&brd->ports[a].port);
922 while (1) { 926 while (1) {
923 opened = 0; 927 opened = 0;
924 for (a = 0; a < brd->numPorts; a++) 928 for (a = 0; a < brd->numPorts; a++)
@@ -941,7 +945,7 @@ static void moxa_board_deinit(struct moxa_board_conf *brd)
941} 945}
942 946
943#ifdef CONFIG_PCI 947#ifdef CONFIG_PCI
944static int __devinit moxa_pci_probe(struct pci_dev *pdev, 948static int moxa_pci_probe(struct pci_dev *pdev,
945 const struct pci_device_id *ent) 949 const struct pci_device_id *ent)
946{ 950{
947 struct moxa_board_conf *board; 951 struct moxa_board_conf *board;
@@ -1016,7 +1020,7 @@ err:
1016 return retval; 1020 return retval;
1017} 1021}
1018 1022
1019static void __devexit moxa_pci_remove(struct pci_dev *pdev) 1023static void moxa_pci_remove(struct pci_dev *pdev)
1020{ 1024{
1021 struct moxa_board_conf *brd = pci_get_drvdata(pdev); 1025 struct moxa_board_conf *brd = pci_get_drvdata(pdev);
1022 1026
@@ -1029,7 +1033,7 @@ static struct pci_driver moxa_pci_driver = {
1029 .name = "moxa", 1033 .name = "moxa",
1030 .id_table = moxa_pcibrds, 1034 .id_table = moxa_pcibrds,
1031 .probe = moxa_pci_probe, 1035 .probe = moxa_pci_probe,
1032 .remove = __devexit_p(moxa_pci_remove) 1036 .remove = moxa_pci_remove
1033}; 1037};
1034#endif /* CONFIG_PCI */ 1038#endif /* CONFIG_PCI */
1035 1039
@@ -1370,7 +1374,7 @@ static void moxa_new_dcdstate(struct moxa_port *p, u8 dcd)
1370 p->DCDState = dcd; 1374 p->DCDState = dcd;
1371 spin_unlock_irqrestore(&p->port.lock, flags); 1375 spin_unlock_irqrestore(&p->port.lock, flags);
1372 tty = tty_port_tty_get(&p->port); 1376 tty = tty_port_tty_get(&p->port);
1373 if (tty && C_CLOCAL(tty) && !dcd) 1377 if (tty && !C_CLOCAL(tty) && !dcd)
1374 tty_hangup(tty); 1378 tty_hangup(tty);
1375 tty_kref_put(tty); 1379 tty_kref_put(tty);
1376 } 1380 }