summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-01-26 17:55:04 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-06-02 11:33:53 +0400
commit93a78e41242ba164ae6af1690ea68fe22165ad4b (patch)
tree5019324d6e41f38207949ebe872ba64e5b851b86
parent7566c6efe75572c63a8841fc09d0a8935b188c2f (diff)
be-hci: use backend functions
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>
-rw-r--r--hw/bt/hci-csr.c9
1 files 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) {
- 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;