summaryrefslogtreecommitdiff
path: root/drivers/serial
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2021-03-03 07:54:55 -0500
committerTom Rini <[email protected]>2021-03-03 07:54:55 -0500
commit23ab54e0933939d201d7c200503bc149128a13db (patch)
tree429522b634bd0e7622128da87ebf84e9891b9737 /drivers/serial
parent78af81c345430a9088235f48d302922955d2499f (diff)
parent795d605cab787e6d9151221312b09391aacfb8e5 (diff)
Merge https://source.denx.de/u-boot/custodians/u-boot-usb
- Kconfig dependency fix for USB_KEYBOARD - musb gadget fixes / enhancements
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/usbtty.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
index f1c1a260da5..4f4eb02de08 100644
--- a/drivers/serial/usbtty.c
+++ b/drivers/serial/usbtty.c
@@ -500,8 +500,8 @@ void usbtty_puts(struct stdio_dev *dev, const char *str)
n = next_nl_pos (str);
if (str[n] == '\n') {
- __usbtty_puts("\r", 1);
- __usbtty_puts(str, n + 1);
+ __usbtty_puts(str, n);
+ __usbtty_puts("\r\n", 2);
str += (n + 1);
len -= (n + 1);
} else {
@@ -849,17 +849,9 @@ static int write_buffer (circbuf_t * buf)
&endpoint_instance[tx_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){
+ if(endpoint->sent < endpoint->tx_urb->actual_length){
if(udc_endpoint_write (endpoint)){
/* Write pre-empted by RX */
return -1;
@@ -878,6 +870,8 @@ static int write_buffer (circbuf_t * buf)
*/
while (buf->size > 0) {
+ current_urb = next_urb (device_instance, endpoint);
+
dest = (char*)current_urb->buffer +
current_urb->actual_length;