From 3f7a2120acde52928e6d3e05f446533677f31078 Mon Sep 17 00:00:00 2001 From: Jason Wessel Date: Thu, 20 Aug 2009 15:39:49 -0500 Subject: [PATCH] --- yaml --- r: 165031 b: refs/heads/master c: 87a5d15154ae2389251e6ad99216a846b905375c h: refs/heads/master i: 165029: 48315e404e4d0598a5ecc37da1c499315af1d7c0 165027: c523d48399a81123d470683d94f022b547a6385e 165023: 61e8a60d7b849cfbe7fe912289be92fda4ec5a8d v: v3 --- [refs] | 2 +- trunk/drivers/usb/early/ehci-dbgp.c | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 526940fbf3d3..0d383921e340 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: df6c516900d48df3581b23d37d6516a22ec4f2ca +refs/heads/master: 87a5d15154ae2389251e6ad99216a846b905375c diff --git a/trunk/drivers/usb/early/ehci-dbgp.c b/trunk/drivers/usb/early/ehci-dbgp.c index 821b7b21c29c..8de709ac0f55 100644 --- a/trunk/drivers/usb/early/ehci-dbgp.c +++ b/trunk/drivers/usb/early/ehci-dbgp.c @@ -700,17 +700,27 @@ int __init early_dbgp_init(char *s) static void early_dbgp_write(struct console *con, const char *str, u32 n) { int chunk, ret; + char buf[DBGP_MAX_PACKET]; + int use_cr = 0; if (!ehci_debug) return; while (n > 0) { - chunk = n; - if (chunk > DBGP_MAX_PACKET) - chunk = DBGP_MAX_PACKET; + for (chunk = 0; chunk < DBGP_MAX_PACKET && n > 0; + str++, chunk++, n--) { + if (!use_cr && *str == '\n') { + use_cr = 1; + buf[chunk] = '\r'; + str--; + n++; + continue; + } + if (use_cr) + use_cr = 0; + buf[chunk] = *str; + } ret = dbgp_bulk_write(USB_DEBUG_DEVNUM, - dbgp_endpoint_out, str, chunk); - str += chunk; - n -= chunk; + dbgp_endpoint_out, buf, chunk); } }