[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 6/7] hw/char/serial: Alias QDEV properties from generic serial
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 6/7] hw/char/serial: Alias QDEV properties from generic serial object |
Date: |
Sat, 12 Sep 2020 13:40:39 +0200 |
Instead of overwritting the properties of the generic 'state'
object, alias them.
Note we can now propagate the "baudbase" property (except on
the PCI multi-UART device).
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/char/serial-isa.c | 4 ++--
hw/char/serial-pci.c | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
index 7e1b36c3f67..c0607476c22 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -118,8 +118,6 @@ static Property serial_isa_properties[] = {
DEFINE_PROP_UINT32("index", ISASerialState, index, -1),
DEFINE_PROP_UINT32("iobase", ISASerialState, iobase, -1),
DEFINE_PROP_UINT32("irq", ISASerialState, isairq, -1),
- DEFINE_PROP_CHR("chardev", ISASerialState, state.chr),
- DEFINE_PROP_BOOL("wakeup", ISASerialState, state.wakeup, false),
DEFINE_PROP_END_OF_LIST(),
};
@@ -140,6 +138,8 @@ static void serial_isa_initfn(Object *o)
ISASerialState *self = ISA_SERIAL(o);
object_initialize_child(o, "serial", &self->state, TYPE_SERIAL);
+
+ qdev_alias_all_properties(DEVICE(&self->state), o);
}
static const TypeInfo serial_isa_info = {
diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index f68948154e0..81da2783f9e 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -84,7 +84,6 @@ static const VMStateDescription vmstate_pci_serial = {
};
static Property serial_pci_properties[] = {
- DEFINE_PROP_CHR("chardev", PCISerialState, state.chr),
DEFINE_PROP_UINT8("prog_if", PCISerialState, prog_if, 0x02),
DEFINE_PROP_END_OF_LIST(),
};
@@ -109,6 +108,8 @@ static void serial_pci_init(Object *o)
PCISerialState *ps = PCI_SERIAL(o);
object_initialize_child(o, "serial", &ps->state, TYPE_SERIAL);
+
+ qdev_alias_all_properties(DEVICE(&ps->state), o);
}
static const TypeInfo serial_pci_info = {
--
2.26.2
- [PATCH v2 0/7] hw/char/serial: Housekeeping, Philippe Mathieu-Daudé, 2020/09/12
- [PATCH v2 1/7] hw/char/serial: Assert serial_ioport_read/write offset fits 8 bytes, Philippe Mathieu-Daudé, 2020/09/12
- [PATCH v2 6/7] hw/char/serial: Alias QDEV properties from generic serial object,
Philippe Mathieu-Daudé <=
- [PATCH v2 3/7] hw/char/serial: Remove old DEBUG_SERIAL commented code, Philippe Mathieu-Daudé, 2020/09/12
- [PATCH v2 4/7] hw/char/serial: Rename I/O read/write trace events, Philippe Mathieu-Daudé, 2020/09/12
- [PATCH v2 2/7] hw/char/serial: Replace commented DPRINTF() by trace event, Philippe Mathieu-Daudé, 2020/09/12
- [PATCH v2 7/7] hw/char/serial: Let SerialState have an 'id' field, Philippe Mathieu-Daudé, 2020/09/12
- [PATCH v2 5/7] hw/char/serial: Make 'wakeup' property boolean, Philippe Mathieu-Daudé, 2020/09/12
- Re: [PATCH v2 0/7] hw/char/serial: Housekeeping, no-reply, 2020/09/12
- Re: [PATCH v2 0/7] hw/char/serial: Housekeeping, no-reply, 2020/09/12