aboutsummaryrefslogtreecommitdiff
path: root/hw/bt/hci-csr.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/bt/hci-csr.c')
-rw-r--r--hw/bt/hci-csr.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/hw/bt/hci-csr.c b/hw/bt/hci-csr.c
index 3c193848fc..d13192b9b5 100644
--- a/hw/bt/hci-csr.c
+++ b/hw/bt/hci-csr.c
@@ -20,7 +20,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
-#include "sysemu/char.h"
+#include "chardev/char-serial.h"
#include "qemu/timer.h"
#include "qemu/bswap.h"
#include "hw/irq.h"
@@ -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) {
- be->chr_read(be->opaque,
- s->outfifo + s->out_start++, 1);
+ if (qemu_chr_be_can_write(chr)) {
+ qemu_chr_be_write(chr, s->outfifo + s->out_start++, 1);
s->out_len--;
if (s->out_start >= s->out_size) {
s->out_start = 0;