diff options
author | Richard Weinberger <richard@nod.at> | 2013-03-11 05:03:42 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2013-03-11 05:08:03 -0400 |
commit | cc4f02486c09977ccbe3ce2276aca5608a44ca00 (patch) | |
tree | 5b0729f494e535b3d5dbbe2e189ded60ae38cea3 /arch/um/drivers | |
parent | 72383d43b223c410fc61d9e905690b9b9ba9d418 (diff) |
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')
-rw-r--r-- | arch/um/drivers/line.c | 26 | ||||
-rw-r--r-- | arch/um/drivers/ssl.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/stdio_console.c | 1 |
3 files changed, 14 insertions, 14 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) | |||
315 | return 0; | 315 | return 0; |
316 | } | 316 | } |
317 | 317 | ||
318 | static void unregister_winch(struct tty_struct *tty); | ||
319 | |||
320 | static void line_destruct(struct tty_port *port) | ||
321 | { | ||
322 | struct tty_struct *tty = tty_port_tty_get(port); | ||
323 | struct line *line = tty->driver_data; | ||
324 | |||
325 | if (line->sigio) { | ||
326 | unregister_winch(tty); | ||
327 | line->sigio = 0; | ||
328 | } | ||
329 | } | ||
330 | |||
318 | static const struct tty_port_operations line_port_ops = { | 331 | static const struct tty_port_operations line_port_ops = { |
319 | .activate = line_activate, | 332 | .activate = line_activate, |
333 | .destruct = line_destruct, | ||
320 | }; | 334 | }; |
321 | 335 | ||
322 | int line_open(struct tty_struct *tty, struct file *filp) | 336 | 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, | |||
340 | return 0; | 354 | return 0; |
341 | } | 355 | } |
342 | 356 | ||
343 | static void unregister_winch(struct tty_struct *tty); | ||
344 | |||
345 | void line_cleanup(struct tty_struct *tty) | ||
346 | { | ||
347 | struct line *line = tty->driver_data; | ||
348 | |||
349 | if (line->sigio) { | ||
350 | unregister_winch(tty); | ||
351 | line->sigio = 0; | ||
352 | } | ||
353 | } | ||
354 | |||
355 | void line_close(struct tty_struct *tty, struct file * filp) | 357 | void line_close(struct tty_struct *tty, struct file * filp) |
356 | { | 358 | { |
357 | struct line *line = tty->driver_data; | 359 | struct line *line = tty->driver_data; |
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c index 16fdd0a0f9d6..b8d14fa52059 100644 --- a/arch/um/drivers/ssl.c +++ b/arch/um/drivers/ssl.c | |||
@@ -105,7 +105,6 @@ static const struct tty_operations ssl_ops = { | |||
105 | .throttle = line_throttle, | 105 | .throttle = line_throttle, |
106 | .unthrottle = line_unthrottle, | 106 | .unthrottle = line_unthrottle, |
107 | .install = ssl_install, | 107 | .install = ssl_install, |
108 | .cleanup = line_cleanup, | ||
109 | .hangup = line_hangup, | 108 | .hangup = line_hangup, |
110 | }; | 109 | }; |
111 | 110 | ||
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c index 827777af3f6d..7b361f36ca96 100644 --- a/arch/um/drivers/stdio_console.c +++ b/arch/um/drivers/stdio_console.c | |||
@@ -110,7 +110,6 @@ static const struct tty_operations console_ops = { | |||
110 | .set_termios = line_set_termios, | 110 | .set_termios = line_set_termios, |
111 | .throttle = line_throttle, | 111 | .throttle = line_throttle, |
112 | .unthrottle = line_unthrottle, | 112 | .unthrottle = line_unthrottle, |
113 | .cleanup = line_cleanup, | ||
114 | .hangup = line_hangup, | 113 | .hangup = line_hangup, |
115 | }; | 114 | }; |
116 | 115 | ||