diff options
Diffstat (limited to 'hw/char/ipoctal232.c')
-rw-r--r-- | hw/char/ipoctal232.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c index 875fe3b22a..d504721a99 100644 --- a/hw/char/ipoctal232.c +++ b/hw/char/ipoctal232.c @@ -289,7 +289,7 @@ static uint16_t io_read(IPackDevice *ip, uint8_t addr) ch->sr &= ~SR_RXRDY; blk->isr &= ~ISR_RXRDY(channel); if (ch->dev.chr) { - qemu_chr_fe_accept_input(ch->dev.chr); + qemu_chr_fe_accept_input(&ch->dev); } } else { ch->rhr_idx = (ch->rhr_idx + 1) % RX_FIFO_SIZE; @@ -362,7 +362,7 @@ static void io_write(IPackDevice *ip, uint8_t addr, uint16_t val) uint8_t thr = reg; /* XXX this blocks entire thread. Rewrite to use * qemu_chr_fe_write and background I/O callbacks */ - qemu_chr_fe_write_all(ch->dev.chr, &thr, 1); + qemu_chr_fe_write_all(&ch->dev, &thr, 1); } } else { DPRINTF("Write THR%c (0x%x), Tx disabled\n", channel + 'a', reg); @@ -546,9 +546,9 @@ static void ipoctal_realize(DeviceState *dev, Error **errp) ch->ipoctal = s; /* Redirect IP-Octal channels to host character devices */ - if (ch->dev.chr) { - qemu_chr_add_handlers(ch->dev.chr, hostdev_can_receive, - hostdev_receive, hostdev_event, ch); + if (qemu_chr_fe_get_driver(&ch->dev)) { + qemu_chr_fe_set_handlers(&ch->dev, hostdev_can_receive, + hostdev_receive, hostdev_event, ch, NULL); DPRINTF("Redirecting channel %u to %s\n", i, ch->dev->label); } else { DPRINTF("Could not redirect channel %u, no chardev set\n", i); |