diff options
author | Tomas Hlavacek <tmshlvck@gmail.com> | 2012-09-06 23:17:47 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-06 14:40:18 -0700 |
commit | b1b799164afb22711e6bee718f2a5ee669bb9517 (patch) | |
tree | 2bb7e2c7513b879531a8f0b898bc5557f4a784ed /drivers/tty/serial | |
parent | 6915c0e487c822e2436683e14302c0b8a6155cc7 (diff) | |
download | linux-b1b799164afb22711e6bee718f2a5ee669bb9517.tar.gz |
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/serial')
-rw-r--r-- | drivers/tty/serial/serial_core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index f629bdf2a8cf..046279ce3e8d 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2313,9 +2313,9 @@ static ssize_t uart_get_attr_uartclk(struct device *dev, struct device_attribute *attr, char *buf) { int ret; - struct tty_port *port = dev_get_drvdata(dev); struct uart_state *state = container_of(port, struct uart_state, port); + mutex_lock(&state->port.mutex); ret = snprintf(buf, PAGE_SIZE, "%d\n", state->uart_port->uartclk); mutex_unlock(&state->port.mutex); @@ -2330,7 +2330,7 @@ static struct attribute *tty_dev_attrs[] = { NULL, }; -static struct attribute_group tty_dev_attr_group = { +static const struct attribute_group tty_dev_attr_group = { .attrs = tty_dev_attrs, }; @@ -2392,8 +2392,8 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) * Register the port whether it's detected or not. This allows * setserial to be used to alter this ports parameters. */ - tty_dev = tty_register_device_attr(drv->tty_driver, uport->line, - uport->dev, port, tty_dev_attr_groups); + tty_dev = tty_port_register_device_attr(port, drv->tty_driver, + uport->line, uport->dev, port, tty_dev_attr_groups); if (likely(!IS_ERR(tty_dev))) { device_set_wakeup_capable(tty_dev, 1); } else { |