]> git.proxmox.com Git - mirror_qemu.git/commitdiff
be-hci: use backend functions
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 26 Jan 2017 13:55:04 +0000 (17:55 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 2 Jun 2017 07:33:53 +0000 (11:33 +0400)
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 <marcandre.lureau@redhat.com>
Reviewed-by: Andrzej Zaborowski <balrogg@gmail.com>
hw/bt/hci-csr.c

index 0f2021086dc2b10d280ecd3865ab8aa71e9000da..d13192b9b57ab5920b73d86e36b779924372ab2e 100644 (file)
@@ -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;