From 112306e71a32b2a50b021e4ca2dd9f279dd169a5 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Wed, 28 Jan 2015 00:38:06 +0530 Subject: [PATCH] ANDROID: arm: dcc_tty: fix armv6 dcc tty build failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix spinlock declaration and tty_insert/flip arguments. If ARM DCC tty driver is enabled then we run into following build failure: ----------   CC      drivers/char/dcc_tty.o drivers/char/dcc_tty.c:29:36: error: ‘SPIN_LOCK_UNLOCKED’ undeclared here (not in a function) drivers/char/dcc_tty.c: In function ‘dcc_poll_locked’: drivers/char/dcc_tty.c:83:4: warning: passing argument 1 of ‘tty_insert_flip_string’ from incompatible pointer type [enabled by default] In file included from drivers/char/dcc_tty.c:23:0: include/linux/tty_flip.h:32:19: note: expected ‘struct tty_port *’ but argument is of type ‘struct tty_struct *’ drivers/char/dcc_tty.c:84:4: warning: passing argument 1 of ‘tty_flip_buffer_push’ from incompatible pointer type [enabled by default] In file included from drivers/char/dcc_tty.c:23:0: include/linux/tty_flip.h:13:13: note: expected ‘struct tty_port *’ but argument is of type ‘struct tty_struct *’ make[2]: *** [drivers/char/dcc_tty.o] Error 1 ---------- Signed-off-by: Amit Pundir (cherry picked from commit 0274b1c917fe1eba159910e4775d981edc446495) (cherry picked from commit 12638ee074657421a0d754c9d5c354d12432e142) Change-Id: I5937cd68a82c2886428edf9558b0e148991a44bc Signed-off-by: Dylan Reid Reviewed-on: https://chromium-review.googlesource.com/285963 Reviewed-by: Olof Johansson --- drivers/char/dcc_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/dcc_tty.c b/drivers/char/dcc_tty.c index a787accdcb14..0a62d410286f 100644 --- a/drivers/char/dcc_tty.c +++ b/drivers/char/dcc_tty.c @@ -26,7 +26,7 @@ MODULE_DESCRIPTION("DCC TTY Driver"); MODULE_LICENSE("GPL"); MODULE_VERSION("1.0"); -static spinlock_t g_dcc_tty_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(g_dcc_tty_lock); static struct hrtimer g_dcc_timer; static char g_dcc_buffer[16]; static int g_dcc_buffer_head; @@ -80,8 +80,8 @@ static void dcc_poll_locked(void) ); if (rch >= 0) { ch = rch; - tty_insert_flip_string(g_dcc_tty, &ch, 1); - tty_flip_buffer_push(g_dcc_tty); + tty_insert_flip_string(g_dcc_tty->port, &ch, 1); + tty_flip_buffer_push(g_dcc_tty->port); } }