mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
hw/char/sh_serial: Delete fifo_timeout_timer in DeviceUnrealize
fifo_timeout_timer is created in the DeviceRealize handler, not in the instance_init one. For parity, delete it in DeviceUnrealize, rather than instance_finalize. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20250124175053.74461-2-philmd@linaro.org>
This commit is contained in:
parent
bc98ffdc75
commit
a5844ea553
1 changed files with 7 additions and 2 deletions
|
@ -434,9 +434,9 @@ static void sh_serial_realize(DeviceState *d, Error **errp)
|
||||||
s->etu = NANOSECONDS_PER_SECOND / 9600;
|
s->etu = NANOSECONDS_PER_SECOND / 9600;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sh_serial_finalize(Object *obj)
|
static void sh_serial_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
SHSerialState *s = SH_SERIAL(obj);
|
SHSerialState *s = SH_SERIAL(dev);
|
||||||
|
|
||||||
timer_del(&s->fifo_timeout_timer);
|
timer_del(&s->fifo_timeout_timer);
|
||||||
}
|
}
|
||||||
|
@ -445,6 +445,10 @@ static void sh_serial_init(Object *obj)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void sh_serial_finalize(Object *obj)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static const Property sh_serial_properties[] = {
|
static const Property sh_serial_properties[] = {
|
||||||
DEFINE_PROP_CHR("chardev", SHSerialState, chr),
|
DEFINE_PROP_CHR("chardev", SHSerialState, chr),
|
||||||
DEFINE_PROP_UINT8("features", SHSerialState, feat, 0),
|
DEFINE_PROP_UINT8("features", SHSerialState, feat, 0),
|
||||||
|
@ -456,6 +460,7 @@ static void sh_serial_class_init(ObjectClass *oc, const void *data)
|
||||||
|
|
||||||
device_class_set_props(dc, sh_serial_properties);
|
device_class_set_props(dc, sh_serial_properties);
|
||||||
dc->realize = sh_serial_realize;
|
dc->realize = sh_serial_realize;
|
||||||
|
dc->unrealize = sh_serial_unrealize;
|
||||||
device_class_set_legacy_reset(dc, sh_serial_reset);
|
device_class_set_legacy_reset(dc, sh_serial_reset);
|
||||||
/* Reason: part of SuperH CPU/SoC, needs to be wired up */
|
/* Reason: part of SuperH CPU/SoC, needs to be wired up */
|
||||||
dc->user_creatable = false;
|
dc->user_creatable = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue