projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://git.denx.de/u-boot-rockchip
[oweals/u-boot.git]
/
drivers
/
serial
/
usbtty.c
diff --git
a/drivers/serial/usbtty.c
b/drivers/serial/usbtty.c
index 75f0ec31bbfb9a6faedeaf9cf137ea1212ceefd5..29799dce93a00fa1a547118fc16d493ad4323da7 100644
(file)
--- a/
drivers/serial/usbtty.c
+++ b/
drivers/serial/usbtty.c
@@
-434,11
+434,12
@@
void usbtty_putc(struct stdio_dev *dev, const char c)
if (!usbtty_configured ())
return;
if (!usbtty_configured ())
return;
- buf_push (&usbtty_output, &c, 1);
/* If \n, also do \r */
if (c == '\n')
buf_push (&usbtty_output, "\r", 1);
/* If \n, also do \r */
if (c == '\n')
buf_push (&usbtty_output, "\r", 1);
+ buf_push(&usbtty_output, &c, 1);
+
/* Poll at end to handle new data... */
if ((usbtty_output.size + 2) >= usbtty_output.totalsize) {
usbtty_poll ();
/* Poll at end to handle new data... */
if ((usbtty_output.size + 2) >= usbtty_output.totalsize) {
usbtty_poll ();
@@
-498,8
+499,8
@@
void usbtty_puts(struct stdio_dev *dev, const char *str)
n = next_nl_pos (str);
if (str[n] == '\n') {
n = next_nl_pos (str);
if (str[n] == '\n') {
- __usbtty_puts
(str, n +
1);
- __usbtty_puts
("\r",
1);
+ __usbtty_puts
("\r",
1);
+ __usbtty_puts
(str, n +
1);
str += (n + 1);
len -= (n + 1);
} else {
str += (n + 1);
len -= (n + 1);
} else {
@@
-849,6
+850,13
@@
static int write_buffer (circbuf_t * buf)
struct urb *current_urb = NULL;
current_urb = next_urb (device_instance, endpoint);
struct urb *current_urb = NULL;
current_urb = next_urb (device_instance, endpoint);
+
+ if (!current_urb) {
+ TTYERR ("current_urb is NULL, buf->size %d\n",
+ buf->size);
+ return 0;
+ }
+
/* TX data still exists - send it now
*/
if(endpoint->sent < current_urb->actual_length){
/* TX data still exists - send it now
*/
if(endpoint->sent < current_urb->actual_length){
@@
-870,12
+878,6
@@
static int write_buffer (circbuf_t * buf)
*/
while (buf->size > 0) {
*/
while (buf->size > 0) {
- if (!current_urb) {
- TTYERR ("current_urb is NULL, buf->size %d\n",
- buf->size);
- return total;
- }
-
dest = (char*)current_urb->buffer +
current_urb->actual_length;
dest = (char*)current_urb->buffer +
current_urb->actual_length;