]> git.proxmox.com Git - mirror_qemu.git/commitdiff
allwinner-i2c, adm1272: Use device_cold_reset() for software-triggered reset
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 12 Apr 2024 16:08:05 +0000 (17:08 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 25 Apr 2024 09:21:06 +0000 (10:21 +0100)
Rather than directly calling the device's implementation of its 'hold'
reset phase, call device_cold_reset(). This means we don't have to
adjust this callsite when we add another argument to the function
signature for the hold and exit reset methods.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Luc Michel <luc.michel@amd.com>
Message-id: 20240412160809.1260625-3-peter.maydell@linaro.org

hw/i2c/allwinner-i2c.c
hw/sensor/adm1272.c

index 8abcc39a5c26144bb4a87ccb1326976a84763335..96c20c8637240c2ac093595be7ad5151e6812145 100644 (file)
@@ -385,8 +385,7 @@ static void allwinner_i2c_write(void *opaque, hwaddr offset,
         break;
     case TWI_SRST_REG:
         if (((value & TWI_SRST_MASK) == 0) && (s->srst & TWI_SRST_MASK)) {
-            /* Perform reset */
-            allwinner_i2c_reset_hold(OBJECT(s));
+            device_cold_reset(DEVICE(s));
         }
         s->srst = value & TWI_SRST_MASK;
         break;
index 1f7c8abb838e82717bb3ea7258fcfb2fddbbdac3..a19557ec9ead51611261a419f9c5f87258ed4c69 100644 (file)
@@ -386,7 +386,7 @@ static int adm1272_write_data(PMBusDevice *pmdev, const uint8_t *buf,
         break;
 
     case ADM1272_MFR_POWER_CYCLE:
-        adm1272_exit_reset((Object *)s);
+        device_cold_reset(DEVICE(s));
         break;
 
     case ADM1272_HYSTERESIS_LOW: