diff options
author | Alan Cox <alan@linux.intel.com> | 2010-06-01 16:52:59 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 16:47:42 -0400 |
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) | |||
1506 | struct uart_state *state = container_of(port, struct uart_state, port); | 1506 | struct uart_state *state = container_of(port, struct uart_state, port); |
1507 | struct uart_port *uport = state->uart_port; | 1507 | struct uart_port *uport = state->uart_port; |
1508 | int mctrl; | 1508 | int mctrl; |
1509 | mutex_lock(&port->mutex); | ||
1510 | spin_lock_irq(&uport->lock); | 1509 | spin_lock_irq(&uport->lock); |
1511 | uport->ops->enable_ms(uport); | 1510 | uport->ops->enable_ms(uport); |
1512 | mctrl = uport->ops->get_mctrl(uport); | 1511 | mctrl = uport->ops->get_mctrl(uport); |
1513 | spin_unlock_irq(&uport->lock); | 1512 | spin_unlock_irq(&uport->lock); |
1514 | mutex_unlock(&port->mutex); | ||
1515 | if (mctrl & TIOCM_CAR) | 1513 | if (mctrl & TIOCM_CAR) |
1516 | return 1; | 1514 | return 1; |
1517 | return 0; | 1515 | return 0; |
@@ -1521,12 +1519,11 @@ static void uart_dtr_rts(struct tty_port *port, int onoff) | |||
1521 | { | 1519 | { |
1522 | struct uart_state *state = container_of(port, struct uart_state, port); | 1520 | struct uart_state *state = container_of(port, struct uart_state, port); |
1523 | struct uart_port *uport = state->uart_port; | 1521 | struct uart_port *uport = state->uart_port; |
1524 | mutex_lock(&port->mutex); | 1522 | |
1525 | if (onoff) | 1523 | if (onoff) |
1526 | uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS); | 1524 | uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS); |
1527 | else | 1525 | else |
1528 | uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS); | 1526 | uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS); |
1529 | mutex_unlock(&port->mutex); | ||
1530 | } | 1527 | } |
1531 | 1528 | ||
1532 | /* | 1529 | /* |