aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_port.c
diff options
context:
space:
mode:
authorTomas Hlavacek <tmshlvck@gmail.com>2012-09-06 17:17:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-06 17:40:18 -0400
commitb1b799164afb22711e6bee718f2a5ee669bb9517 (patch)
tree2bb7e2c7513b879531a8f0b898bc5557f4a784ed /drivers/tty/tty_port.c
parent6915c0e487c822e2436683e14302c0b8a6155cc7 (diff)
tty_register_device_attr updated for tty-next
Added tty_device_create_release() and bound to dev->release in tty_register_device_attr(). Added tty_port_register_device_attr() and used in uart_add_one_port() instead of tty_register_device_attr(). Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_port.c')
-rw-r--r--drivers/tty/tty_port.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index 96302f4c7079..d7bdd8d0c23f 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -73,6 +73,30 @@ struct device *tty_port_register_device(struct tty_port *port,
73} 73}
74EXPORT_SYMBOL_GPL(tty_port_register_device); 74EXPORT_SYMBOL_GPL(tty_port_register_device);
75 75
76/**
77 * tty_port_register_device_attr - register tty device
78 * @port: tty_port of the device
79 * @driver: tty_driver for this device
80 * @index: index of the tty
81 * @device: parent if exists, otherwise NULL
82 * @drvdata: Driver data to be set to device.
83 * @attr_grp: Attribute group to be set on device.
84 *
85 * It is the same as tty_register_device_attr except the provided @port is
86 * linked to a concrete tty specified by @index. Use this or tty_port_install
87 * (or both). Call tty_port_link_device as a last resort.
88 */
89struct device *tty_port_register_device_attr(struct tty_port *port,
90 struct tty_driver *driver, unsigned index,
91 struct device *device, void *drvdata,
92 const struct attribute_group **attr_grp)
93{
94 tty_port_link_device(port, driver, index);
95 return tty_register_device_attr(driver, index, device, drvdata,
96 attr_grp);
97}
98EXPORT_SYMBOL_GPL(tty_port_register_device_attr);
99
76int tty_port_alloc_xmit_buf(struct tty_port *port) 100int tty_port_alloc_xmit_buf(struct tty_port *port)
77{ 101{
78 /* We may sleep in get_zeroed_page() */ 102 /* We may sleep in get_zeroed_page() */