diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2022-03-05 15:09:51 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2022-03-09 09:28:28 +0000 |
commit | c697fc80a8e7ee0594afbbf0758fcf889f47d31e (patch) | |
tree | b10281877cb159727ce56379449df4acdf3d96fe /hw/misc/mac_via.c | |
parent | 9d9f4eac2c8fd7a623d7b91e21d08d34ce50315d (diff) |
mos6522: use device_class_set_parent_reset() to propagate reset to parent
Switch from using a legacy approach to the more formal approach for propagating
device reset to the parent.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220305150957.5053-7-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/misc/mac_via.c')
-rw-r--r-- | hw/misc/mac_via.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c index 80eb433044..3f473c3fcf 100644 --- a/hw/misc/mac_via.c +++ b/hw/misc/mac_via.c @@ -1076,9 +1076,11 @@ static Property mos6522_q800_via1_properties[] = { static void mos6522_q800_via1_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); + MOS6522DeviceClass *mdc = MOS6522_CLASS(oc); dc->realize = mos6522_q800_via1_realize; - dc->reset = mos6522_q800_via1_reset; + device_class_set_parent_reset(dc, mos6522_q800_via1_reset, + &mdc->parent_reset); dc->vmsd = &vmstate_q800_via1; device_class_set_props(dc, mos6522_q800_via1_properties); } @@ -1161,7 +1163,8 @@ static void mos6522_q800_via2_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); MOS6522DeviceClass *mdc = MOS6522_CLASS(oc); - dc->reset = mos6522_q800_via2_reset; + device_class_set_parent_reset(dc, mos6522_q800_via2_reset, + &mdc->parent_reset); dc->vmsd = &vmstate_q800_via2; mdc->portB_write = mos6522_q800_via2_portB_write; } |