linux-next: build failure after merge of the tty tree

From: Stephen Rothwell
Date: Thu Sep 06 2012 - 01:10:19 EST


Hi Greg,

After merging the tty tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

In file included from drivers/tty/serial/sccnxp.c:20:0:
include/linux/serial_core.h: In function 'uart_handle_break':
include/linux/serial_core.h:543:30: error: dereferencing pointer to incomplete type

Caused by commit 1d65c0b12656 ("serial: New serial driver SCCNXP"). This
seems to be just exposing a preexisting problem with linux/serial_core.h:
when SUPPORT_SYSRQ is defined, this header depends on linux/console.h. I
can only imagein that every other use of serial_core.h pre-includes
(maybe indirectly) console.h (or doesn't define SUPPORT_SYSRQ).

I have applied the following patch, but a better solution should be
figured out.

From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Date: Thu, 6 Sep 2012 15:05:04 +1000
Subject: [PATCH] serial: serial_core.h needs console.h included first

Fixes these build errors:

In file included from drivers/tty/serial/sccnxp.c:20:0:
include/linux/serial_core.h: In function 'uart_handle_break':
include/linux/serial_core.h:543:30: error: dereferencing pointer to incomplete type

Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
---
drivers/tty/serial/sccnxp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index 29dda9b..05d767c 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -17,12 +17,12 @@

#include <linux/module.h>
#include <linux/device.h>
+#include <linux/console.h>
#include <linux/serial_core.h>
#include <linux/serial.h>
#include <linux/io.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
-#include <linux/console.h>
#include <linux/platform_device.h>
#include <linux/platform_data/sccnxp.h>

--
1.7.10.280.gaa39

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx

Attachment: pgp00000.pgp
Description: PGP signature