diff options
author | Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | 2014-11-06 03:23:00 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-06 18:00:44 -0500 |
commit | bd737f8738b7e15930aa7b47c94c28a8d83148ac (patch) | |
tree | 9140a208d4856074a92ffc6543aabcf08a38a762 /drivers/tty/serial/omap-serial.c | |
parent | a9c20a9cf3190a517b88d8e08d93157256f97673 (diff) |
tty/serial_core: Introduce lock mechanism for RS485
Introduce an homogeneous lock system between setting and using the rs485
data of the uart_port.
This patch should not be split into multiple ones in order to avoid
leaving the tree in an unstable state.
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Suggested-by: Alan Cox <alan@linux.intel.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/omap-serial.c')
-rw-r--r-- | drivers/tty/serial/omap-serial.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 050d1b5c7b36..e0bec06a5f60 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c | |||
@@ -1360,12 +1360,10 @@ static int | |||
1360 | serial_omap_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf) | 1360 | serial_omap_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf) |
1361 | { | 1361 | { |
1362 | struct uart_omap_port *up = to_uart_omap_port(port); | 1362 | struct uart_omap_port *up = to_uart_omap_port(port); |
1363 | unsigned long flags; | ||
1364 | unsigned int mode; | 1363 | unsigned int mode; |
1365 | int val; | 1364 | int val; |
1366 | 1365 | ||
1367 | pm_runtime_get_sync(up->dev); | 1366 | pm_runtime_get_sync(up->dev); |
1368 | spin_lock_irqsave(&up->port.lock, flags); | ||
1369 | 1367 | ||
1370 | /* Disable interrupts from this port */ | 1368 | /* Disable interrupts from this port */ |
1371 | mode = up->ier; | 1369 | mode = up->ier; |
@@ -1401,7 +1399,6 @@ serial_omap_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf) | |||
1401 | serial_out(up, UART_OMAP_SCR, up->scr); | 1399 | serial_out(up, UART_OMAP_SCR, up->scr); |
1402 | } | 1400 | } |
1403 | 1401 | ||
1404 | spin_unlock_irqrestore(&up->port.lock, flags); | ||
1405 | pm_runtime_mark_last_busy(up->dev); | 1402 | pm_runtime_mark_last_busy(up->dev); |
1406 | pm_runtime_put_autosuspend(up->dev); | 1403 | pm_runtime_put_autosuspend(up->dev); |
1407 | 1404 | ||