[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 06/12] mos6522: use device_class_set_parent_reset() to propaga
From: |
Mark Cave-Ayland |
Subject: |
[PATCH v4 06/12] mos6522: use device_class_set_parent_reset() to propagate reset to parent |
Date: |
Sat, 5 Mar 2022 15:09:51 +0000 |
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>
---
hw/misc/mac_via.c | 7 +++++--
hw/misc/macio/cuda.c | 3 ++-
hw/misc/macio/pmu.c | 3 ++-
hw/misc/mos6522.c | 1 -
4 files changed, 9 insertions(+), 5 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;
}
diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c
index 693fc82e05..1498113cfc 100644
--- a/hw/misc/macio/cuda.c
+++ b/hw/misc/macio/cuda.c
@@ -606,7 +606,8 @@ static void mos6522_cuda_class_init(ObjectClass *oc, void
*data)
DeviceClass *dc = DEVICE_CLASS(oc);
MOS6522DeviceClass *mdc = MOS6522_CLASS(oc);
- dc->reset = mos6522_cuda_reset;
+ device_class_set_parent_reset(dc, mos6522_cuda_reset,
+ &mdc->parent_reset);
mdc->portB_write = mos6522_cuda_portB_write;
mdc->get_timer1_counter_value = cuda_get_counter_value;
mdc->get_timer2_counter_value = cuda_get_counter_value;
diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c
index b210068ab7..5b1ec100e2 100644
--- a/hw/misc/macio/pmu.c
+++ b/hw/misc/macio/pmu.c
@@ -850,7 +850,8 @@ static void mos6522_pmu_class_init(ObjectClass *oc, void
*data)
DeviceClass *dc = DEVICE_CLASS(oc);
MOS6522DeviceClass *mdc = MOS6522_CLASS(oc);
- dc->reset = mos6522_pmu_reset;
+ device_class_set_parent_reset(dc, mos6522_pmu_reset,
+ &mdc->parent_reset);
mdc->portB_write = mos6522_pmu_portB_write;
mdc->portA_write = mos6522_pmu_portA_write;
}
diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c
index 4c3147a7d1..093cc83dcf 100644
--- a/hw/misc/mos6522.c
+++ b/hw/misc/mos6522.c
@@ -519,7 +519,6 @@ static void mos6522_class_init(ObjectClass *oc, void *data)
dc->reset = mos6522_reset;
dc->vmsd = &vmstate_mos6522;
device_class_set_props(dc, mos6522_properties);
- mdc->parent_reset = dc->reset;
mdc->portB_write = mos6522_portB_write;
mdc->portA_write = mos6522_portA_write;
mdc->get_timer1_counter_value = mos6522_get_counter_value;
--
2.20.1
- [PATCH v4 00/12] mos6522: switch to gpios, add control line edge-triggering and extra debugging, Mark Cave-Ayland, 2022/03/05
- [PATCH v4 01/12] mos6522: add defines for IFR bit flags, Mark Cave-Ayland, 2022/03/05
- [PATCH v4 02/12] mac_via: use IFR bit flag constants for VIA1 IRQs, Mark Cave-Ayland, 2022/03/05
- [PATCH v4 04/12] mos6522: switch over to use qdev gpios for IRQs, Mark Cave-Ayland, 2022/03/05
- [PATCH v4 03/12] mac_via: use IFR bit flag constants for VIA2 IRQs, Mark Cave-Ayland, 2022/03/05
- [PATCH v4 05/12] mos6522: remove update_irq() and set_sr_int() methods from MOS6522DeviceClass, Mark Cave-Ayland, 2022/03/05
- [PATCH v4 06/12] mos6522: use device_class_set_parent_reset() to propagate reset to parent,
Mark Cave-Ayland <=
- [PATCH v4 07/12] mos6522: add register names to register read/write trace events, Mark Cave-Ayland, 2022/03/05
- [PATCH v4 08/12] mos6522: add "info via" HMP command for debugging, Mark Cave-Ayland, 2022/03/05
- [PATCH v4 09/12] mos6522: record last_irq_levels in mos6522_set_irq(), Mark Cave-Ayland, 2022/03/05
- [PATCH v4 10/12] mac_via: make SCSI_DATA (DRQ) bit live rather than latched, Mark Cave-Ayland, 2022/03/05
- [PATCH v4 11/12] mos6522: implement edge-triggering for CA1/2 and CB1/2 control line IRQs, Mark Cave-Ayland, 2022/03/05
- [PATCH v4 12/12] macio/pmu.c: remove redundant code, Mark Cave-Ayland, 2022/03/05