From: "Oscar Alejandro Sánchez Lucero" <aleszlucero@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Oscar Alejandro Sánchez Lucero" <aleszlucero@gmail.com>
Subject: [PATCH 2/3] hw/sensor/emc141x: Convert to Resettable interface
Date: Tue, 01 Dec 2026 15:16:49 +0000 [thread overview]
Message-ID: <20261201-sensor-resettable-v1-2-497c3be8ae80@gmail.com> (raw)
In-Reply-To: <20261201-sensor-resettable-v1-0-497c3be8ae80@gmail.com>
Replace the deprecated device_class_set_legacy_reset() with the
Resettable interface by implementing the hold phase in
emc141x_reset_hold().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
hw/sensor/emc141x.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/sensor/emc141x.c b/hw/sensor/emc141x.c
index f53ee9f..d183fae 100644
--- a/hw/sensor/emc141x.c
+++ b/hw/sensor/emc141x.c
@@ -238,9 +238,9 @@ static const VMStateDescription vmstate_emc141x = {
}
};
-static void emc141x_reset(DeviceState *dev)
+static void emc141x_reset_hold(Object *obj, ResetType type)
{
- EMC141XState *s = EMC141X(dev);
+ EMC141XState *s = EMC141X(obj);
int i;
for (i = 0; i < SENSORS_COUNT_MAX; i++) {
@@ -270,8 +270,9 @@ static void emc141x_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
- device_class_set_legacy_reset(dc, emc141x_reset);
+ rc->phases.hold = emc141x_reset_hold;
k->event = emc141x_event;
k->recv = emc141x_rx;
k->send = emc141x_tx;
--
2.53.0
next prev parent reply other threads:[~2026-12-01 15:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 15:16 [PATCH 0/3] hw/sensor: Convert I2C sensor devices to Resettable interface Oscar Alejandro Sánchez Lucero
2026-12-01 15:16 ` [PATCH 1/3] hw/sensor/dps310: Convert " Oscar Alejandro Sánchez Lucero
2026-12-01 15:16 ` Oscar Alejandro Sánchez Lucero [this message]
2026-12-01 15:16 ` [PATCH 3/3] hw/sensor/lsm303dlhc_mag: " Oscar Alejandro Sánchez Lucero
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261201-sensor-resettable-v1-2-497c3be8ae80@gmail.com \
--to=aleszlucero@gmail.com \
--cc=philmd@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.