linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] serial: digicolor: fix sysrq handling
Date: Tue, 13 Jan 2015 15:37:11 +0100	[thread overview]
Message-ID: <1730002.vWGOEymGdz@wuerfel> (raw)

Trying to build the digicolor-usart driver when sysrq is disabled
results in a compile error:

drivers/tty/serial/digicolor-usart.c: In function 'digicolor_uart_console_write':
drivers/tty/serial/digicolor-usart.c:407:33: error: 'struct uart_port' has no member named 'sysrq'

Like a lot of other drivers, this one requires an #ifdef to avoid
accessing the sysrq field here. While looking into this, I noticed
that the case where sysrq support is enabled is also broken, because
the driver fails to set the SUPPORT_SYSRQ macro.

This patch hopefully fixes both, but I do not hardware to test if sysrq
is actually working now.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/digicolor-usart.c
index 09ce0b3764e2..1e4bdd895804 100644
--- a/drivers/tty/serial/digicolor-usart.c
+++ b/drivers/tty/serial/digicolor-usart.c
@@ -23,6 +23,10 @@
 #include <linux/platform_device.h>
 #include <linux/workqueue.h>
 
+#if defined(CONFIG_SERIAL_CONEXANT_DIGICOLOR_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+#define SUPPORT_SYSRQ
+#endif
+
 #define UA_ENABLE			0x00
 #define UA_ENABLE_ENABLE		BIT(0)
 
@@ -403,10 +407,11 @@ static void digicolor_uart_console_write(struct console *co, const char *c,
 	u8 status;
 	unsigned long flags;
 	int locked = 1;
-
+#ifdef SUPPORT_SYSRQ
 	if (port->sysrq || oops_in_progress)
 		locked = spin_trylock_irqsave(&port->lock, flags);
 	else
+#endif
 		spin_lock_irqsave(&port->lock, flags);
 
 	uart_console_write(port, c, n, digicolor_uart_console_putchar);

             reply	other threads:[~2015-01-13 14:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13 14:37 Arnd Bergmann [this message]
2015-01-14  5:57 ` [PATCH] serial: digicolor: fix sysrq handling Baruch Siach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1730002.vWGOEymGdz@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).