aboutsummaryrefslogtreecommitdiff
path: root/hw/char/lm32_uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/char/lm32_uart.c')
-rw-r--r--hw/char/lm32_uart.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c
index be93697a39..72fc41c90f 100644
--- a/hw/char/lm32_uart.c
+++ b/hw/char/lm32_uart.c
@@ -97,7 +97,7 @@ struct LM32UartState {
SysBusDevice parent_obj;
MemoryRegion iomem;
- CharDriverState *chr;
+ CharBackend chr;
qemu_irq irq;
uint32_t regs[R_MAX];
@@ -142,7 +142,7 @@ static uint64_t uart_read(void *opaque, hwaddr addr,
r = s->regs[R_RXTX];
s->regs[R_LSR] &= ~LSR_DR;
uart_update_irq(s);
- qemu_chr_accept_input(s->chr);
+ qemu_chr_accept_input(s->chr.chr);
break;
case R_IIR:
case R_LSR:
@@ -177,10 +177,10 @@ static void uart_write(void *opaque, hwaddr addr,
addr >>= 2;
switch (addr) {
case R_RXTX:
- if (s->chr) {
+ if (s->chr.chr) {
/* XXX this blocks entire thread. Rewrite to use
* qemu_chr_fe_write and background I/O callbacks */
- qemu_chr_fe_write_all(s->chr, &ch, 1);
+ qemu_chr_fe_write_all(s->chr.chr, &ch, 1);
}
break;
case R_IER:
@@ -267,8 +267,8 @@ static void lm32_uart_realize(DeviceState *dev, Error **errp)
{
LM32UartState *s = LM32_UART(dev);
- if (s->chr) {
- qemu_chr_add_handlers(s->chr, uart_can_rx, uart_rx, uart_event, s);
+ if (s->chr.chr) {
+ qemu_chr_add_handlers(s->chr.chr, uart_can_rx, uart_rx, uart_event, s);
}
}