From 4bd82136cdf04f3a8d50e20c1b76da750f75f2db Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 1 Nov 2012 16:43:49 +0000 Subject: moxa: dcd handling of CLOCAL is backwards We should do hangup on dcd loss if CLOCAL is false not true. Signed-off-by: Alan Cox Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=49911 Signed-off-by: Greg Kroah-Hartman --- drivers/tty/moxa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty/moxa.c') diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 56e616b9109..9b57aae139f 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -1370,7 +1370,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); } -- cgit v1.2.3-18-g5258 From 191c5f10275cfbb36802edadbdb10c73537327b4 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Thu, 15 Nov 2012 09:49:56 +0100 Subject: TTY: call tty_port_destroy in the rest of drivers After commit "TTY: move tty buffers to tty_port", the tty buffers are not freed in some drivers. This is because tty_port_destructor is not called whenever a tty_port is freed. This was an assumption I counted with but was unfortunately untrue. So fix the drivers to fulfil this assumption. To be sure, the TTY buffers (and later some stuff) are gone along with the tty_port, we have to call tty_port_destroy at tear-down places. This is mostly where the structure containing a tty_port is freed. This patch does exactly that -- put tty_port_destroy at those places. Signed-off-by: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- drivers/tty/moxa.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/tty/moxa.c') diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 9b57aae139f..d628176fb6d 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++) -- cgit v1.2.3-18-g5258 From 91116cba5da0c33f3093b804e487bea02b830bfb Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Mon, 19 Nov 2012 13:21:06 -0500 Subject: tty: remove use of __devexit_p CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton Cc: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- drivers/tty/moxa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty/moxa.c') diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index d628176fb6d..e025e065ae9 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -1033,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 */ -- cgit v1.2.3-18-g5258 From 9671f09921d93e722a28ae9610d478e092ac5466 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Mon, 19 Nov 2012 13:21:50 -0500 Subject: tty: remove use of __devinit CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton Cc: Jiri Slaby Cc: Alan Cox Cc: Lucas Tavares Cc: "David S. Miller" Cc: Peter Korsgaard Cc: Tony Prisk Acked-by: Tobias Klauser Acked-by: Nicolas Ferre Signed-off-by: Greg Kroah-Hartman --- drivers/tty/moxa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty/moxa.c') diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index e025e065ae9..60ea74e76d3 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -945,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; -- cgit v1.2.3-18-g5258 From ae8d8a146725a966bd7c59c94f4d0016dcf7a04f Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Mon, 19 Nov 2012 13:26:18 -0500 Subject: tty: remove use of __devexit CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton Cc: Jiri Slaby Cc: Alan Cox Acked-by: Tobias Klauser Cc: Lucas Tavares Cc: Daniel Walker Cc: Bryan Huntsman Cc: "David S. Miller" Cc: Peter Korsgaard Cc: Tony Prisk Acked-by: David Brown Signed-off-by: Greg Kroah-Hartman --- drivers/tty/moxa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty/moxa.c') diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 60ea74e76d3..f9d28503bde 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -1020,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); -- cgit v1.2.3-18-g5258