aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-06-04 07:35:37 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-13 20:30:54 -0400
commit057eb856eda1d957c0f1155eaa90739221f809a7 (patch)
tree0f538f728b63c4d0545d4340b2fc175a64ffeb75 /drivers
parent04831dc154df9b83c3e5fd54b18448da507871f7 (diff)
TTY: add tty_port_register_device helper
This will automatically assign tty_port to tty_driver's port array for later recall in tty_init_dev. This is intended to be called instead of tty_register_device. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/tty_port.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index 1ac8abf4708d..4e9d2b291f4a 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -33,6 +33,15 @@ void tty_port_init(struct tty_port *port)
33} 33}
34EXPORT_SYMBOL(tty_port_init); 34EXPORT_SYMBOL(tty_port_init);
35 35
36struct device *tty_port_register_device(struct tty_port *port,
37 struct tty_driver *driver, unsigned index,
38 struct device *device)
39{
40 driver->ports[index] = port;
41 return tty_register_device(driver, index, device);
42}
43EXPORT_SYMBOL_GPL(tty_port_register_device);
44
36int tty_port_alloc_xmit_buf(struct tty_port *port) 45int tty_port_alloc_xmit_buf(struct tty_port *port)
37{ 46{
38 /* We may sleep in get_zeroed_page() */ 47 /* We may sleep in get_zeroed_page() */