diff mbox

[PULL,v4,03/12] milkymist-uart: use qemu_chr_fe_write_all() instead of qemu_chr_fe_write()

Message ID 1390246471-25167-4-git-send-email-michael@walle.cc
State New
Headers show

Commit Message

Michael Walle Jan. 20, 2014, 7:34 p.m. UTC
From: Antony Pavlov <antonynpavlov@gmail.com>

qemu_chr_fe_write() is capable of returning 0
to indicate EAGAIN (and friends) and we don't
handle this.

Just change it to qemu_chr_fe_write_all() to fix.

Reported-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Michael Walle <michael@walle.cc>
---
 hw/char/milkymist-uart.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Maydell Feb. 1, 2014, 5:46 p.m. UTC | #1
On 20 January 2014 19:34, Michael Walle <michael@walle.cc> wrote:
> From: Antony Pavlov <antonynpavlov@gmail.com>
>
> qemu_chr_fe_write() is capable of returning 0
> to indicate EAGAIN (and friends) and we don't
> handle this.
>
> Just change it to qemu_chr_fe_write_all() to fix.
>
> Reported-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> Signed-off-by: Michael Walle <michael@walle.cc>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
diff mbox

Patch

diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c
index 2c52a0f..da51f82 100644
--- a/hw/char/milkymist-uart.c
+++ b/hw/char/milkymist-uart.c
@@ -124,7 +124,7 @@  static void uart_write(void *opaque, hwaddr addr, uint64_t value,
     switch (addr) {
     case R_RXTX:
         if (s->chr) {
-            qemu_chr_fe_write(s->chr, &ch, 1);
+            qemu_chr_fe_write_all(s->chr, &ch, 1);
         }
         s->regs[R_STAT] |= STAT_TX_EVT;
         break;