summaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/line.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2013-03-11 10:03:42 +0100
committerRichard Weinberger <richard@nod.at>2013-03-11 10:08:03 +0100
commitcc4f02486c09977ccbe3ce2276aca5608a44ca00 (patch)
tree5b0729f494e535b3d5dbbe2e189ded60ae38cea3 /arch/um/drivers/line.c
parentum: fix build failure due to mess-up of sig_info protorype (diff)
downloadlinux-cc4f02486c09977ccbe3ce2276aca5608a44ca00.tar.xz
linux-cc4f02486c09977ccbe3ce2276aca5608a44ca00.zip
um: Use tty_port_operations->destruct
As we setup the SIGWINCH handler in tty_port_operations->activate it makes sense to tear down it in ->destruct. Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/drivers/line.c')
-rw-r--r--arch/um/drivers/line.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index f1b38571f94e..232243aec70c 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -315,8 +315,22 @@ static int line_activate(struct tty_port *port, struct tty_struct *tty)
return 0;
}
+static void unregister_winch(struct tty_struct *tty);
+
+static void line_destruct(struct tty_port *port)
+{
+ struct tty_struct *tty = tty_port_tty_get(port);
+ struct line *line = tty->driver_data;
+
+ if (line->sigio) {
+ unregister_winch(tty);
+ line->sigio = 0;
+ }
+}
+
static const struct tty_port_operations line_port_ops = {
.activate = line_activate,
+ .destruct = line_destruct,
};
int line_open(struct tty_struct *tty, struct file *filp)
@@ -340,18 +354,6 @@ int line_install(struct tty_driver *driver, struct tty_struct *tty,
return 0;
}
-static void unregister_winch(struct tty_struct *tty);
-
-void line_cleanup(struct tty_struct *tty)
-{
- struct line *line = tty->driver_data;
-
- if (line->sigio) {
- unregister_winch(tty);
- line->sigio = 0;
- }
-}
-
void line_close(struct tty_struct *tty, struct file * filp)
{
struct line *line = tty->driver_data;