aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/common
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2012-03-15 12:57:20 -0700
committerRuchi Kandoi <kandoiruchi@google.com>2015-02-03 16:48:43 -0800
commit3696393f04a919eb35e0fe96e090a1dad3ebd23d (patch)
tree791b03d09305fbf7d35ae1e9561fde7c99603d87 /arch/arm/common
parentb3de636eefc32bb87b6f6017826c18442c7473e0 (diff)
ARM: fiq_debugger: add debug_putc
Convert all the calls to state->pdata->uart_putc to a debug_putc helper. Change-Id: Idc007bd170ff1b51d0325e238105ae0c86d23777 Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch/arm/common')
-rw-r--r--arch/arm/common/fiq_debugger.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/arch/arm/common/fiq_debugger.c b/arch/arm/common/fiq_debugger.c
index 3f75495fab02..909ef56596e8 100644
--- a/arch/arm/common/fiq_debugger.c
+++ b/arch/arm/common/fiq_debugger.c
@@ -174,13 +174,18 @@ static void debug_uart_flush(struct fiq_debugger_state *state)
state->pdata->uart_flush(state->pdev);
}
+static void debug_putc(struct fiq_debugger_state *state, char c)
+{
+ state->pdata->uart_putc(state->pdev, c);
+}
+
static void debug_puts(struct fiq_debugger_state *state, char *s)
{
unsigned c;
while ((c = *s++)) {
if (c == '\n')
- state->pdata->uart_putc(state->pdev, '\r');
- state->pdata->uart_putc(state->pdev, c);
+ debug_putc(state, '\r');
+ debug_putc(state, c);
}
}
@@ -777,19 +782,19 @@ static bool debug_handle_uart_interrupt(struct fiq_debugger_state *state,
} else if ((c >= ' ') && (c < 127)) {
if (state->debug_count < (DEBUG_MAX - 1)) {
state->debug_buf[state->debug_count++] = c;
- state->pdata->uart_putc(state->pdev, c);
+ debug_putc(state, c);
}
} else if ((c == 8) || (c == 127)) {
if (state->debug_count > 0) {
state->debug_count--;
- state->pdata->uart_putc(state->pdev, 8);
- state->pdata->uart_putc(state->pdev, ' ');
- state->pdata->uart_putc(state->pdev, 8);
+ debug_putc(state, 8);
+ debug_putc(state, ' ');
+ debug_putc(state, 8);
}
} else if ((c == 13) || (c == 10)) {
if (c == '\r' || (c == '\n' && last_c != '\r')) {
- state->pdata->uart_putc(state->pdev, '\r');
- state->pdata->uart_putc(state->pdev, '\n');
+ debug_putc(state, '\r');
+ debug_putc(state, '\n');
}
if (state->debug_count) {
state->debug_buf[state->debug_count] = 0;
@@ -898,8 +903,8 @@ static void debug_console_write(struct console *co,
debug_uart_enable(state);
while (count--) {
if (*s == '\n')
- state->pdata->uart_putc(state->pdev, '\r');
- state->pdata->uart_putc(state->pdev, *s++);
+ debug_putc(state, '\r');
+ debug_putc(state, *s++);
}
debug_uart_flush(state);
debug_uart_disable(state);
@@ -941,7 +946,7 @@ int fiq_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)
debug_uart_enable(state);
for (i = 0; i < count; i++)
- state->pdata->uart_putc(state->pdev, *buf++);
+ debug_putc(state, *buf++);
debug_uart_disable(state);
return count;