Skip to content

Commit cc4f024

Browse files
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>
1 parent 72383d4 commit cc4f024

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

arch/um/drivers/line.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,22 @@ static int line_activate(struct tty_port *port, struct tty_struct *tty)
315315
return 0;
316316
}
317317

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+
318331
static const struct tty_port_operations line_port_ops = {
319332
.activate = line_activate,
333+
.destruct = line_destruct,
320334
};
321335

322336
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,
340354
return 0;
341355
}
342356

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-
355357
void line_close(struct tty_struct *tty, struct file * filp)
356358
{
357359
struct line *line = tty->driver_data;

arch/um/drivers/ssl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ static const struct tty_operations ssl_ops = {
105105
.throttle = line_throttle,
106106
.unthrottle = line_unthrottle,
107107
.install = ssl_install,
108-
.cleanup = line_cleanup,
109108
.hangup = line_hangup,
110109
};
111110

arch/um/drivers/stdio_console.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ static const struct tty_operations console_ops = {
110110
.set_termios = line_set_termios,
111111
.throttle = line_throttle,
112112
.unthrottle = line_unthrottle,
113-
.cleanup = line_cleanup,
114113
.hangup = line_hangup,
115114
};
116115

0 commit comments

Comments
 (0)