From e3d0814368d00e7985c31edf5d0cfce45972d4be Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 13 Sep 2024 15:31:44 +0100 Subject: 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 Reviewed-by: Richard Henderson Message-id: 20240830145812.1967042-8-peter.maydell@linaro.org --- hw/sensor/dps310.c | 2 +- hw/sensor/emc141x.c | 2 +- hw/sensor/lsm303dlhc_mag.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'hw/sensor') diff --git a/hw/sensor/dps310.c b/hw/sensor/dps310.c index 01c776dd7a..6966a53248 100644 --- a/hw/sensor/dps310.c +++ b/hw/sensor/dps310.c @@ -205,7 +205,7 @@ static void dps310_class_init(ObjectClass *klass, void *data) k->event = dps310_event; k->recv = dps310_rx; k->send = dps310_tx; - dc->reset = dps310_reset; + device_class_set_legacy_reset(dc, dps310_reset); dc->vmsd = &vmstate_dps310; } diff --git a/hw/sensor/emc141x.c b/hw/sensor/emc141x.c index 95079558e8..aeccd2a3c9 100644 --- a/hw/sensor/emc141x.c +++ b/hw/sensor/emc141x.c @@ -270,7 +270,7 @@ static void emc141x_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); - dc->reset = emc141x_reset; + device_class_set_legacy_reset(dc, emc141x_reset); k->event = emc141x_event; k->recv = emc141x_rx; k->send = emc141x_tx; diff --git a/hw/sensor/lsm303dlhc_mag.c b/hw/sensor/lsm303dlhc_mag.c index 343ff98990..04471539b5 100644 --- a/hw/sensor/lsm303dlhc_mag.c +++ b/hw/sensor/lsm303dlhc_mag.c @@ -535,7 +535,7 @@ static void lsm303dlhc_mag_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); - dc->reset = lsm303dlhc_mag_reset; + device_class_set_legacy_reset(dc, lsm303dlhc_mag_reset); dc->vmsd = &vmstate_lsm303dlhc_mag; k->event = lsm303dlhc_mag_event; k->recv = lsm303dlhc_mag_recv; -- cgit 1.4.1