diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-10-22 12:52:59 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-10-24 15:27:21 +0200 |
commit | fa394ed625731c18f904578903718bf16617fe92 (patch) | |
tree | 224ba9825ba286e3fcffc48394a3a4c1afbc9531 /hw/char/etraxfs_ser.c | |
parent | c39860e6dc90f6ee2e82ee078f978c5d7f3df86a (diff) |
char: make some qemu_chr_fe skip if no driver
In most cases, front ends do not care about the side effect of
CharBackend, so we can simply skip the checks and call the qemu_chr_fe
functions even without associated CharDriver.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20161022095318.17775-20-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/char/etraxfs_ser.c')
-rw-r--r-- | hw/char/etraxfs_ser.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c index d812954345..18c374b95c 100644 --- a/hw/char/etraxfs_ser.c +++ b/hw/char/etraxfs_ser.c @@ -231,11 +231,9 @@ static void etraxfs_ser_realize(DeviceState *dev, Error **errp) { ETRAXSerial *s = ETRAX_SERIAL(dev); - if (s->chr.chr) { - qemu_chr_fe_set_handlers(&s->chr, - serial_can_receive, serial_receive, - serial_event, s, NULL); - } + qemu_chr_fe_set_handlers(&s->chr, + serial_can_receive, serial_receive, + serial_event, s, NULL); } static void etraxfs_ser_class_init(ObjectClass *klass, void *data) |