提交 3abe8c76 编写于 作者: P Peter Hurley 提交者: Greg Kroah-Hartman

serial: core: Fold do_uart_get_info() into caller

do_uart_get_info() has a single caller: uart_get_info().
Manually inline do_uart_get_info().
Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 f5291ecc
...@@ -671,14 +671,18 @@ static void uart_unthrottle(struct tty_struct *tty) ...@@ -671,14 +671,18 @@ static void uart_unthrottle(struct tty_struct *tty)
uart_set_mctrl(port, TIOCM_RTS); uart_set_mctrl(port, TIOCM_RTS);
} }
static void do_uart_get_info(struct tty_port *port, static void uart_get_info(struct tty_port *port, struct serial_struct *retinfo)
struct serial_struct *retinfo)
{ {
struct uart_state *state = container_of(port, struct uart_state, port); struct uart_state *state = container_of(port, struct uart_state, port);
struct uart_port *uport = state->uart_port; struct uart_port *uport = state->uart_port;
memset(retinfo, 0, sizeof(*retinfo)); memset(retinfo, 0, sizeof(*retinfo));
/*
* Ensure the state we copy is consistent and no hardware changes
* occur as we go
*/
mutex_lock(&port->mutex);
retinfo->type = uport->type; retinfo->type = uport->type;
retinfo->line = uport->line; retinfo->line = uport->line;
retinfo->port = uport->iobase; retinfo->port = uport->iobase;
...@@ -697,15 +701,6 @@ static void do_uart_get_info(struct tty_port *port, ...@@ -697,15 +701,6 @@ static void do_uart_get_info(struct tty_port *port,
retinfo->io_type = uport->iotype; retinfo->io_type = uport->iotype;
retinfo->iomem_reg_shift = uport->regshift; retinfo->iomem_reg_shift = uport->regshift;
retinfo->iomem_base = (void *)(unsigned long)uport->mapbase; retinfo->iomem_base = (void *)(unsigned long)uport->mapbase;
}
static void uart_get_info(struct tty_port *port,
struct serial_struct *retinfo)
{
/* Ensure the state we copy is consistent and no hardware changes
occur as we go */
mutex_lock(&port->mutex);
do_uart_get_info(port, retinfo);
mutex_unlock(&port->mutex); mutex_unlock(&port->mutex);
} }
...@@ -713,6 +708,7 @@ static int uart_get_info_user(struct tty_port *port, ...@@ -713,6 +708,7 @@ static int uart_get_info_user(struct tty_port *port,
struct serial_struct __user *retinfo) struct serial_struct __user *retinfo)
{ {
struct serial_struct tmp; struct serial_struct tmp;
uart_get_info(port, &tmp); uart_get_info(port, &tmp);
if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册