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/ide | |
parent | 134e0944f473c4d87a67f7e6ec70f0205a8e30c7 (diff) | |
download | qemu-e3d0814368d00e7985c31edf5d0cfce45972d4be.zip qemu-e3d0814368d00e7985c31edf5d0cfce45972d4be.tar.gz qemu-e3d0814368d00e7985c31edf5d0cfce45972d4be.tar.bz2 |
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/ide')
-rw-r--r-- | hw/ide/ahci.c | 2 | ||||
-rw-r--r-- | hw/ide/cmd646.c | 2 | ||||
-rw-r--r-- | hw/ide/ich.c | 2 | ||||
-rw-r--r-- | hw/ide/isa.c | 2 | ||||
-rw-r--r-- | hw/ide/macio.c | 2 | ||||
-rw-r--r-- | hw/ide/microdrive.c | 2 | ||||
-rw-r--r-- | hw/ide/mmio.c | 2 | ||||
-rw-r--r-- | hw/ide/piix.c | 4 | ||||
-rw-r--r-- | hw/ide/sii3112.c | 2 | ||||
-rw-r--r-- | hw/ide/via.c | 2 |
10 files changed, 11 insertions, 11 deletions
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index bfefad2..7fc2a08 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1878,7 +1878,7 @@ static void sysbus_ahci_class_init(ObjectClass *klass, void *data) dc->realize = sysbus_ahci_realize; dc->vmsd = &vmstate_sysbus_ahci; device_class_set_props(dc, sysbus_ahci_properties); - dc->reset = sysbus_ahci_reset; + device_class_set_legacy_reset(dc, sysbus_ahci_reset); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c index 8cebd1b..6b02fc8 100644 --- a/hw/ide/cmd646.c +++ b/hw/ide/cmd646.c @@ -323,7 +323,7 @@ static void cmd646_ide_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); - dc->reset = cmd646_reset; + device_class_set_legacy_reset(dc, cmd646_reset); dc->vmsd = &vmstate_ide_pci; k->realize = pci_cmd646_ide_realize; k->exit = pci_cmd646_ide_exitfn; diff --git a/hw/ide/ich.c b/hw/ide/ich.c index 9b909c8..b311450 100644 --- a/hw/ide/ich.c +++ b/hw/ide/ich.c @@ -176,7 +176,7 @@ static void ich_ahci_class_init(ObjectClass *klass, void *data) k->revision = 0x02; k->class_id = PCI_CLASS_STORAGE_SATA; dc->vmsd = &vmstate_ich9_ahci; - dc->reset = pci_ich9_reset; + device_class_set_legacy_reset(dc, pci_ich9_reset); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/ide/isa.c b/hw/ide/isa.c index 934c458..211ebc9 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -114,7 +114,7 @@ static void isa_ide_class_initfn(ObjectClass *klass, void *data) dc->realize = isa_ide_realizefn; dc->fw_name = "ide"; - dc->reset = isa_ide_reset; + device_class_set_legacy_reset(dc, isa_ide_reset); device_class_set_props(dc, isa_ide_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/ide/macio.c b/hw/ide/macio.c index e84bf2c..bec2e86 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -476,7 +476,7 @@ static void macio_ide_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); dc->realize = macio_ide_realizefn; - dc->reset = macio_ide_reset; + device_class_set_legacy_reset(dc, macio_ide_reset); device_class_set_props(dc, macio_ide_properties); dc->vmsd = &vmstate_pmac; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c index 3bb152b..5475d59 100644 --- a/hw/ide/microdrive.c +++ b/hw/ide/microdrive.c @@ -622,7 +622,7 @@ static void microdrive_class_init(ObjectClass *oc, void *data) pcc->io_write = md_common_write; dc->realize = microdrive_realize; - dc->reset = md_reset; + device_class_set_legacy_reset(dc, md_reset); dc->vmsd = &vmstate_microdrive; } diff --git a/hw/ide/mmio.c b/hw/ide/mmio.c index 8736281..53d22fb 100644 --- a/hw/ide/mmio.c +++ b/hw/ide/mmio.c @@ -151,7 +151,7 @@ static void mmio_ide_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); dc->realize = mmio_ide_realizefn; - dc->reset = mmio_ide_reset; + device_class_set_legacy_reset(dc, mmio_ide_reset); device_class_set_props(dc, mmio_ide_properties); dc->vmsd = &vmstate_ide_mmio; } diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 80efc63..818ff60 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -183,7 +183,7 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); - dc->reset = piix_ide_reset; + device_class_set_legacy_reset(dc, piix_ide_reset); dc->vmsd = &vmstate_ide_pci; k->realize = pci_piix_ide_realize; k->exit = pci_piix_ide_exitfn; @@ -206,7 +206,7 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); - dc->reset = piix_ide_reset; + device_class_set_legacy_reset(dc, piix_ide_reset); dc->vmsd = &vmstate_ide_pci; k->realize = pci_piix_ide_realize; k->exit = pci_piix_ide_exitfn; diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c index af17384..ce8a1e4 100644 --- a/hw/ide/sii3112.c +++ b/hw/ide/sii3112.c @@ -300,7 +300,7 @@ static void sii3112_pci_class_init(ObjectClass *klass, void *data) pd->class_id = PCI_CLASS_STORAGE_RAID; pd->revision = 1; pd->realize = sii3112_pci_realize; - dc->reset = sii3112_reset; + device_class_set_legacy_reset(dc, sii3112_reset); dc->desc = "SiI3112A SATA controller"; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/ide/via.c b/hw/ide/via.c index a32f56b..c88eb6c 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -250,7 +250,7 @@ static void via_ide_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); - dc->reset = via_ide_reset; + device_class_set_legacy_reset(dc, via_ide_reset); dc->vmsd = &vmstate_ide_pci; /* Reason: only works as function of VIA southbridge */ dc->user_creatable = false; |