Commit 24fcc7c8 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

serial: trim locking on the helpers

The port mutex protects port->tty, but these paths never need to walk from
port->tty. They do need the low level lock as the API expects that but they
already also take it.

Thus we can drop the extra mutex lock calls here.
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent de0c8cb3
...@@ -1506,12 +1506,10 @@ static int uart_carrier_raised(struct tty_port *port) ...@@ -1506,12 +1506,10 @@ static int uart_carrier_raised(struct tty_port *port)
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;
int mctrl; int mctrl;
mutex_lock(&port->mutex);
spin_lock_irq(&uport->lock); spin_lock_irq(&uport->lock);
uport->ops->enable_ms(uport); uport->ops->enable_ms(uport);
mctrl = uport->ops->get_mctrl(uport); mctrl = uport->ops->get_mctrl(uport);
spin_unlock_irq(&uport->lock); spin_unlock_irq(&uport->lock);
mutex_unlock(&port->mutex);
if (mctrl & TIOCM_CAR) if (mctrl & TIOCM_CAR)
return 1; return 1;
return 0; return 0;
...@@ -1521,12 +1519,11 @@ static void uart_dtr_rts(struct tty_port *port, int onoff) ...@@ -1521,12 +1519,11 @@ static void uart_dtr_rts(struct tty_port *port, int onoff)
{ {
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;
mutex_lock(&port->mutex);
if (onoff) if (onoff)
uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS); uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
else else
uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS); uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
mutex_unlock(&port->mutex);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment