mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
hw/char/sh_serial: Convert to TypeInfo
QOM types are now registered using as TypeInfo via DEFINE_TYPES() or type_init(). Update TYPE_SH_SERIAL, removing the empty QOM instance_init/finalize handlers. This was definitely wrong, because OBJECT_DEFINE_TYPE() is only for cases where the class needs its own virtual methods or some other per-class state in its own class struct. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20250124175053.74461-3-philmd@linaro.org>
This commit is contained in:
parent
a5844ea553
commit
65561d9393
1 changed files with 11 additions and 12 deletions
|
@ -78,10 +78,6 @@ struct SHSerialState {
|
|||
qemu_irq bri;
|
||||
};
|
||||
|
||||
typedef struct {} SHSerialStateClass;
|
||||
|
||||
OBJECT_DEFINE_TYPE(SHSerialState, sh_serial, SH_SERIAL, SYS_BUS_DEVICE)
|
||||
|
||||
static void sh_serial_clear_fifo(SHSerialState *s)
|
||||
{
|
||||
memset(s->rx_fifo, 0, SH_RX_FIFO_LENGTH);
|
||||
|
@ -441,14 +437,6 @@ static void sh_serial_unrealize(DeviceState *dev)
|
|||
timer_del(&s->fifo_timeout_timer);
|
||||
}
|
||||
|
||||
static void sh_serial_init(Object *obj)
|
||||
{
|
||||
}
|
||||
|
||||
static void sh_serial_finalize(Object *obj)
|
||||
{
|
||||
}
|
||||
|
||||
static const Property sh_serial_properties[] = {
|
||||
DEFINE_PROP_CHR("chardev", SHSerialState, chr),
|
||||
DEFINE_PROP_UINT8("features", SHSerialState, feat, 0),
|
||||
|
@ -465,3 +453,14 @@ static void sh_serial_class_init(ObjectClass *oc, const void *data)
|
|||
/* Reason: part of SuperH CPU/SoC, needs to be wired up */
|
||||
dc->user_creatable = false;
|
||||
}
|
||||
|
||||
static const TypeInfo sh_serial_types[] = {
|
||||
{
|
||||
.name = TYPE_SH_SERIAL,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(SHSerialState),
|
||||
.class_init = sh_serial_class_init,
|
||||
},
|
||||
};
|
||||
|
||||
DEFINE_TYPES(sh_serial_types)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue