summaryrefslogtreecommitdiff
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
authorTomas Hlavacek <tmshlvck@gmail.com>2012-09-07 01:17:47 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-07 01:40:18 +0400
commitb1b799164afb22711e6bee718f2a5ee669bb9517 (patch)
tree2bb7e2c7513b879531a8f0b898bc5557f4a784ed /drivers/tty/tty_io.c
parent6915c0e487c822e2436683e14302c0b8a6155cc7 (diff)
downloadlinux-b1b799164afb22711e6bee718f2a5ee669bb9517.tar.xz
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_io.c')
-rw-r--r--drivers/tty/tty_io.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index dcb30d55d39c..8a5a8b064616 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -3045,6 +3045,12 @@ struct device *tty_register_device(struct tty_driver *driver, unsigned index,
}
EXPORT_SYMBOL(tty_register_device);
+static void tty_device_create_release(struct device *dev)
+{
+ pr_debug("device: '%s': %s\n", dev_name(dev), __func__);
+ kfree(dev);
+}
+
/**
* tty_register_device_attr - register a tty device
* @driver: the tty driver that describes the tty device
@@ -3103,6 +3109,7 @@ struct device *tty_register_device_attr(struct tty_driver *driver,
dev->devt = devt;
dev->class = tty_class;
dev->parent = device;
+ dev->release = tty_device_create_release;
dev_set_name(dev, "%s", name);
dev->groups = attr_grp;
dev_set_drvdata(dev, drvdata);