From 695586ca20c56cf8cfa87160383307a288d32496 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mon, 4 Jun 2012 13:35:32 +0200 Subject: [PATCH] TTY: provide drivers with tty_port_install This will be used in tty_ops->install to set tty->port (and to call tty_standard_install). Signed-off-by: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- drivers/tty/tty_port.c | 8 ++++++++ include/linux/tty.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index bf6e238..1ac8abf 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c @@ -413,6 +413,14 @@ void tty_port_close(struct tty_port *port, struct tty_struct *tty, } EXPORT_SYMBOL(tty_port_close); +int tty_port_install(struct tty_port *port, struct tty_driver *driver, + struct tty_struct *tty) +{ + tty->port = port; + return tty_standard_install(driver, tty); +} +EXPORT_SYMBOL_GPL(tty_port_install); + int tty_port_open(struct tty_port *port, struct tty_struct *tty, struct file *filp) { diff --git a/include/linux/tty.h b/include/linux/tty.h index 9f47ab5..45ef71d 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -521,6 +521,8 @@ extern int tty_port_close_start(struct tty_port *port, extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); extern void tty_port_close(struct tty_port *port, struct tty_struct *tty, struct file *filp); +extern int tty_port_install(struct tty_port *port, struct tty_driver *driver, + struct tty_struct *tty); extern int tty_port_open(struct tty_port *port, struct tty_struct *tty, struct file *filp); static inline int tty_port_users(struct tty_port *port) -- 2.7.4