diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2024-09-13 15:31:44 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2024-09-13 15:31:44 +0100 |
commit | e3d0814368d00e7985c31edf5d0cfce45972d4be (patch) | |
tree | 407e29ccd0f2b505acc614e61e5755cf4dbc5dc3 /hw/s390x | |
parent | 134e0944f473c4d87a67f7e6ec70f0205a8e30c7 (diff) |
hw: Use device_class_set_legacy_reset() instead of opencoding
Use device_class_set_legacy_reset() instead of opencoding an
assignment to DeviceClass::reset. This change was produced
with:
spatch --macro-file scripts/cocci-macro-file.h \
--sp-file scripts/coccinelle/device-reset.cocci \
--keep-comments --smpl-spacing --in-place --dir hw
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20240830145812.1967042-8-peter.maydell@linaro.org
Diffstat (limited to 'hw/s390x')
-rw-r--r-- | hw/s390x/event-facility.c | 2 | ||||
-rw-r--r-- | hw/s390x/ipl.c | 2 | ||||
-rw-r--r-- | hw/s390x/s390-pci-bus.c | 4 | ||||
-rw-r--r-- | hw/s390x/sclpquiesce.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index 06c1da0ece..2b0332c20e 100644 --- a/hw/s390x/event-facility.c +++ b/hw/s390x/event-facility.c @@ -467,7 +467,7 @@ static void init_event_facility_class(ObjectClass *klass, void *data) SCLPEventFacilityClass *k = EVENT_FACILITY_CLASS(dc); dc->realize = realize_event_facility; - dc->reset = reset_event_facility; + device_class_set_legacy_reset(dc, reset_event_facility); dc->vmsd = &vmstate_event_facility; set_bit(DEVICE_CATEGORY_MISC, dc->categories); k->command_handler = command_handler; diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index e934bf89d1..dd71689642 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -770,7 +770,7 @@ static void s390_ipl_class_init(ObjectClass *klass, void *data) dc->realize = s390_ipl_realize; device_class_set_props(dc, s390_ipl_properties); - dc->reset = s390_ipl_reset; + device_class_set_legacy_reset(dc, s390_ipl_reset); dc->vmsd = &vmstate_ipl; set_bit(DEVICE_CATEGORY_MISC, dc->categories); /* Reason: Loads the ROMs and thus can only be used one time - internally */ diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 3e57d5faca..40b2567aa7 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -1323,7 +1323,7 @@ static void s390_pcihost_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass); - dc->reset = s390_pcihost_reset; + device_class_set_legacy_reset(dc, s390_pcihost_reset); dc->realize = s390_pcihost_realize; dc->unrealize = s390_pcihost_unrealize; hc->pre_plug = s390_pcihost_pre_plug; @@ -1506,7 +1506,7 @@ static void s390_pci_device_class_init(ObjectClass *klass, void *data) dc->desc = "zpci device"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->reset = s390_pci_device_reset; + device_class_set_legacy_reset(dc, s390_pci_device_reset); dc->bus_type = TYPE_S390_PCI_BUS; dc->realize = s390_pci_device_realize; device_class_set_props(dc, s390_pci_device_properties); diff --git a/hw/s390x/sclpquiesce.c b/hw/s390x/sclpquiesce.c index 14936aa94b..a32d6a91f5 100644 --- a/hw/s390x/sclpquiesce.c +++ b/hw/s390x/sclpquiesce.c @@ -117,7 +117,7 @@ static void quiesce_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); SCLPEventClass *k = SCLP_EVENT_CLASS(klass); - dc->reset = quiesce_reset; + device_class_set_legacy_reset(dc, quiesce_reset); dc->vmsd = &vmstate_sclpquiesce; set_bit(DEVICE_CATEGORY_MISC, dc->categories); /* |