Update KGDB serial driver for AMBA PL011 UARTs:
- enclose printascii() calls into #ifdef CONFIG_DEBUG_LL;
- remove useless parens/operators in the 'do {} while' statements;
- correct typos and update copyright in the heading comment;
- cleanup whitespace a bit...
Signed-off-by: Deepak Saxena <[EMAIL PROTECTED]>
Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]>
---
This patch is against linux_2_6_21_uprev branch and is based on Deepak's patch.
drivers/serial/pl011_kgdb.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
Index: linux-2.6/drivers/serial/pl011_kgdb.c
===================================================================
--- linux-2.6.orig/drivers/serial/pl011_kgdb.c
+++ linux-2.6/drivers/serial/pl011_kgdb.c
@@ -1,12 +1,12 @@
/*
- * driver/serial/pl011-kgdb.c
+ * driver/serial/pl011_kgdb.c
*
- * Support for KGDB on ARM AMBA PL011 UARTS
+ * Support for KGDB on ARM AMBA PL011 UARTs
*
* Authors: Manish Lachwani <[EMAIL PROTECTED]>
* Deepak Saxena <[EMAIL PROTECTED]>
*
- * Copyright (c) 2005-2006 MontaVista Software, Inc.
+ * Copyright (c) 2005-2007 MontaVista Software, Inc.
*
* This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any
@@ -56,7 +56,7 @@ static void kgdb_serial_putchar(u8 ch)
do {
status = readw(kgdb_port + UART01x_FR);
- } while (!((status & UART01x_FR_TXFF) == 0));
+ } while (status & UART01x_FR_TXFF);
writew(ch, kgdb_port + UART01x_DR);
}
@@ -66,15 +66,19 @@ static int kgdb_serial_getchar(void)
unsigned int status;
int ch;
+#ifdef CONFIG_DEBUG_LL
printascii("Entering serial_getchar loop");
+#endif
do {
status = readw(kgdb_port + UART01x_FR);
- } while ((status & UART01x_FR_RXFE));
+ } while (status & UART01x_FR_RXFE);
ch = readw(kgdb_port + UART01x_DR);
+#ifdef CONFIG_DEBUG_LL
printascii("Exited serial_getchar loop");
printascii("Read char: ");
printch(ch);
printascii("\n");
+#endif
return ch;
}
@@ -82,7 +86,9 @@ static irqreturn_t kgdb_interrupt(int ir
{
int status = readw(kgdb_port + UART011_MIS);
+#ifdef CONFIG_DEBUG_LL
printascii("KGDB irq\n");
+#endif
if (irq != kgdb_irq)
return IRQ_NONE;
@@ -100,7 +106,6 @@ static void __init kgdb_hookup_irq(void)
struct kgdb_io kgdb_io_ops = {
.init = kgdb_serial_init,
.write_char = kgdb_serial_putchar,
- .read_char = kgdb_serial_getchar,
- .late_init = kgdb_hookup_irq,
+ .read_char = kgdb_serial_getchar,
+ .late_init = kgdb_hookup_irq,
};
-
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport