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/sd | |
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/sd')
-rw-r--r-- | hw/sd/allwinner-sdhost.c | 2 | ||||
-rw-r--r-- | hw/sd/aspeed_sdhci.c | 2 | ||||
-rw-r--r-- | hw/sd/bcm2835_sdhost.c | 2 | ||||
-rw-r--r-- | hw/sd/cadence_sdhci.c | 2 | ||||
-rw-r--r-- | hw/sd/npcm7xx_sdhci.c | 2 | ||||
-rw-r--r-- | hw/sd/pl181.c | 2 | ||||
-rw-r--r-- | hw/sd/pxa2xx_mmci.c | 2 | ||||
-rw-r--r-- | hw/sd/sd.c | 2 | ||||
-rw-r--r-- | hw/sd/sdhci.c | 2 | ||||
-rw-r--r-- | hw/sd/ssi-sd.c | 2 |
10 files changed, 10 insertions, 10 deletions
diff --git a/hw/sd/allwinner-sdhost.c b/hw/sd/allwinner-sdhost.c index a1b7230..bcfb4c1 100644 --- a/hw/sd/allwinner-sdhost.c +++ b/hw/sd/allwinner-sdhost.c @@ -900,7 +900,7 @@ static void allwinner_sdhost_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->reset = allwinner_sdhost_reset; + device_class_set_legacy_reset(dc, allwinner_sdhost_reset); dc->vmsd = &vmstate_allwinner_sdhost; dc->realize = allwinner_sdhost_realize; device_class_set_props(dc, allwinner_sdhost_properties); diff --git a/hw/sd/aspeed_sdhci.c b/hw/sd/aspeed_sdhci.c index 3b63926..427e533 100644 --- a/hw/sd/aspeed_sdhci.c +++ b/hw/sd/aspeed_sdhci.c @@ -193,7 +193,7 @@ static void aspeed_sdhci_class_init(ObjectClass *classp, void *data) DeviceClass *dc = DEVICE_CLASS(classp); dc->realize = aspeed_sdhci_realize; - dc->reset = aspeed_sdhci_reset; + device_class_set_legacy_reset(dc, aspeed_sdhci_reset); dc->vmsd = &vmstate_aspeed_sdhci; device_class_set_props(dc, aspeed_sdhci_properties); } diff --git a/hw/sd/bcm2835_sdhost.c b/hw/sd/bcm2835_sdhost.c index 11c54dd..4e411ff 100644 --- a/hw/sd/bcm2835_sdhost.c +++ b/hw/sd/bcm2835_sdhost.c @@ -432,7 +432,7 @@ static void bcm2835_sdhost_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->reset = bcm2835_sdhost_reset; + device_class_set_legacy_reset(dc, bcm2835_sdhost_reset); dc->vmsd = &vmstate_bcm2835_sdhost; } diff --git a/hw/sd/cadence_sdhci.c b/hw/sd/cadence_sdhci.c index 7c8bc54..ad9daa2 100644 --- a/hw/sd/cadence_sdhci.c +++ b/hw/sd/cadence_sdhci.c @@ -171,7 +171,7 @@ static void cadence_sdhci_class_init(ObjectClass *classp, void *data) dc->desc = "Cadence SD/SDIO/eMMC Host Controller (SD4HC)"; dc->realize = cadence_sdhci_realize; - dc->reset = cadence_sdhci_reset; + device_class_set_legacy_reset(dc, cadence_sdhci_reset); dc->vmsd = &vmstate_cadence_sdhci; } diff --git a/hw/sd/npcm7xx_sdhci.c b/hw/sd/npcm7xx_sdhci.c index fb51821..99028c1 100644 --- a/hw/sd/npcm7xx_sdhci.c +++ b/hw/sd/npcm7xx_sdhci.c @@ -155,7 +155,7 @@ static void npcm7xx_sdhci_class_init(ObjectClass *classp, void *data) dc->desc = "NPCM7xx SD/eMMC Host Controller"; dc->realize = npcm7xx_sdhci_realize; - dc->reset = npcm7xx_sdhci_reset; + device_class_set_legacy_reset(dc, npcm7xx_sdhci_reset); dc->vmsd = &vmstate_npcm7xx_sdhci; } diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index e3633c2..51b10ca 100644 --- a/hw/sd/pl181.c +++ b/hw/sd/pl181.c @@ -514,7 +514,7 @@ static void pl181_class_init(ObjectClass *klass, void *data) DeviceClass *k = DEVICE_CLASS(klass); k->vmsd = &vmstate_pl181; - k->reset = pl181_reset; + device_class_set_legacy_reset(k, pl181_reset); /* Reason: output IRQs should be wired up */ k->user_creatable = false; } diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 8252970..a834be7 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -564,7 +564,7 @@ static void pxa2xx_mmci_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_pxa2xx_mmci; - dc->reset = pxa2xx_mmci_reset; + device_class_set_legacy_reset(dc, pxa2xx_mmci_reset); } static void pxa2xx_mmci_bus_class_init(ObjectClass *klass, void *data) @@ -2819,7 +2819,7 @@ static void sdmmc_common_class_init(ObjectClass *klass, void *data) device_class_set_props(dc, sdmmc_common_properties); dc->vmsd = &sd_vmstate; - dc->reset = sd_reset; + device_class_set_legacy_reset(dc, sd_reset); dc->bus_type = TYPE_SD_BUS; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 8293d83..87122e4 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -1520,7 +1520,7 @@ void sdhci_common_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); dc->vmsd = &sdhci_vmstate; - dc->reset = sdhci_poweron_reset; + device_class_set_legacy_reset(dc, sdhci_poweron_reset); } /* --- qdev SysBus --- */ diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c index 2dd070f..1594051 100644 --- a/hw/sd/ssi-sd.c +++ b/hw/sd/ssi-sd.c @@ -398,7 +398,7 @@ static void ssi_sd_class_init(ObjectClass *klass, void *data) k->transfer = ssi_sd_transfer; k->cs_polarity = SSI_CS_LOW; dc->vmsd = &vmstate_ssi_sd; - dc->reset = ssi_sd_reset; + device_class_set_legacy_reset(dc, ssi_sd_reset); /* Reason: GPIO chip-select line should be wired up */ dc->user_creatable = false; } |