Avoid accessing CharBackend directly, use qemu_chr_be_* methods instead.
be->chr_read should exists if qemu_chr_be_can_write() is true.
(use qemu_chr_be_write(), _impl() bypasses replay)
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/bt/hci-csr.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/hw/bt/hci-csr.c b/hw/bt/hci-csr.c
index 0f2021086d..d13192b9b5 100644
--- a/hw/bt/hci-csr.c
+++ b/hw/bt/hci-csr.c
@@ -82,17 +82,14 @@ enum {
static inline void csrhci_fifo_wake(struct csrhci_s *s)
{
- Chardev *chr = (Chardev *)s;
- CharBackend *be = chr->be;
+ Chardev *chr = CHARDEV(s);
if (!s->enable || !s->out_len)
return;
/* XXX: Should wait for s->modem_state & CHR_TIOCM_RTS? */
- if (be && be->chr_can_read && be->chr_can_read(be->opaque) &&
- be->chr_read) {
+ if (qemu_chr_be_can_write(chr)) {
- be->chr_read(be->opaque,
- s->outfifo + s->out_start++, 1);
+ qemu_chr_be_write(chr, s->outfifo + s->out_start++, 1);