lm32_uart/lm32_juart: use qemu_chr_fe_write_all()
qemu_chr_fe_write() may return EAGAIN. Therefore, use qemu_chr_fe_write_all(). Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
		
							parent
							
								
									b2c623a3d9
								
							
						
					
					
						commit
						02d3bf7fe7
					
				@ -75,7 +75,7 @@ void lm32_juart_set_jtx(DeviceState *d, uint32_t jtx)
 | 
			
		||||
 | 
			
		||||
    s->jtx = jtx;
 | 
			
		||||
    if (s->chr) {
 | 
			
		||||
        qemu_chr_fe_write(s->chr, &ch, 1);
 | 
			
		||||
        qemu_chr_fe_write_all(s->chr, &ch, 1);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -177,7 +177,7 @@ static void uart_write(void *opaque, hwaddr addr,
 | 
			
		||||
    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);
 | 
			
		||||
        }
 | 
			
		||||
        break;
 | 
			
		||||
    case R_IER:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user