diff options
author | Alan Cox <alan@linux.intel.com> | 2010-06-01 22:52:59 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 13:47:42 -0700 |
commit | 24fcc7c8cd0fcabcf37d455abe3501b3196fcf64 (patch) | |
tree | 2003e099e16cb2204226253a95b3fbac981977c2 /drivers/serial | |
parent | de0c8cb314cc737c47a00de33cd6246accf94192 (diff) |
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: Alan Cox <alan@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/serial_core.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 2379045e0871..0603e0d46d33 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -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_port *uport = state->uart_port; int mctrl; - mutex_lock(&port->mutex); spin_lock_irq(&uport->lock); uport->ops->enable_ms(uport); mctrl = uport->ops->get_mctrl(uport); spin_unlock_irq(&uport->lock); - mutex_unlock(&port->mutex); if (mctrl & TIOCM_CAR) return 1; return 0; @@ -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_port *uport = state->uart_port; - mutex_lock(&port->mutex); + if (onoff) uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS); else uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS); - mutex_unlock(&port->mutex); } /* |