summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-10-29 16:19:57 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-30 22:05:31 +0100
commitbebe73e31d98845c8b63e624c25a5da2d819345a (patch)
treeea5908162dbb231f1f6e11e6bbddbd5278d55e10
parentserial: 8250_pci: use module_pci_driver to simplify the code (diff)
downloadlinux-bebe73e31d98845c8b63e624c25a5da2d819345a.tar.xz
linux-bebe73e31d98845c8b63e624c25a5da2d819345a.zip
uart: update the sysfs handler to use uart_get_info
The two patches needed are now in the tree. The first added the sysfs interface and directly accesses the uartclk. The second provides a proper interface for getting the values. Wire them together. This formes a basis for both get and set methods for any of the other uart properties and we can now fill them out further. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/serial_core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 0fcfd98a9566..477e0790ddf2 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2329,15 +2329,15 @@ struct tty_driver *uart_console_device(struct console *co, int *index)
static ssize_t uart_get_attr_uartclk(struct device *dev,
struct device_attribute *attr, char *buf)
{
- int ret;
+ struct serial_struct tmp;
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);
+ mutex_lock(&port->mutex);
+ uart_get_info(port, state, &tmp);
+ mutex_unlock(&port->mutex);
- return ret;
+ return snprintf(buf, PAGE_SIZE, "%d\n", tmp.baud_base * 16);
}
static DEVICE_ATTR(uartclk, S_IRUSR | S_IRGRP, uart_get_attr_uartclk, NULL);