aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sunzilog.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/sunzilog.c')
-rw-r--r--drivers/tty/serial/sunzilog.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c
index 45a8c6aa5837..a2c40ed287d2 100644
--- a/drivers/tty/serial/sunzilog.c
+++ b/drivers/tty/serial/sunzilog.c
@@ -1195,20 +1195,16 @@ sunzilog_console_write(struct console *con, const char *s, unsigned int count)
1195 unsigned long flags; 1195 unsigned long flags;
1196 int locked = 1; 1196 int locked = 1;
1197 1197
1198 local_irq_save(flags); 1198 if (up->port.sysrq || oops_in_progress)
1199 if (up->port.sysrq) { 1199 locked = spin_trylock_irqsave(&up->port.lock, flags);
1200 locked = 0; 1200 else
1201 } else if (oops_in_progress) { 1201 spin_lock_irqsave(&up->port.lock, flags);
1202 locked = spin_trylock(&up->port.lock);
1203 } else
1204 spin_lock(&up->port.lock);
1205 1202
1206 uart_console_write(&up->port, s, count, sunzilog_putchar); 1203 uart_console_write(&up->port, s, count, sunzilog_putchar);
1207 udelay(2); 1204 udelay(2);
1208 1205
1209 if (locked) 1206 if (locked)
1210 spin_unlock(&up->port.lock); 1207 spin_unlock_irqrestore(&up->port.lock, flags);
1211 local_irq_restore(flags);
1212} 1208}
1213 1209
1214static int __init sunzilog_console_setup(struct console *con, char *options) 1210static int __init sunzilog_console_setup(struct console *con, char *options)