qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-arm] [RFC PATCH 07/17] convert qdev/bus_reset_all to Resettable


From: Damien Hedde
Subject: [Qemu-arm] [RFC PATCH 07/17] convert qdev/bus_reset_all to Resettable
Date: Mon, 25 Mar 2019 12:01:50 +0100

Change qdev/bus_reset_all implementation. It now triggers a warm reset
using the Resettable interface.

Signed-off-by: Damien Hedde <address@hidden>
---
 hw/core/qdev.c | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 8dae26d957..7adf234474 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -320,25 +320,9 @@ static void device_reset_exit_phase(Object *obj)
     }
 }
 
-static int qdev_reset_one(DeviceState *dev, void *opaque)
-{
-    device_reset(dev);
-
-    return 0;
-}
-
-static int qbus_reset_one(BusState *bus, void *opaque)
-{
-    BusClass *bc = BUS_GET_CLASS(bus);
-    if (bc->reset) {
-        bc->reset(bus);
-    }
-    return 0;
-}
-
 void qdev_reset_all(DeviceState *dev)
 {
-    qdev_walk_children(dev, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL);
+    qdev_reset(dev, false);
 }
 
 void qdev_reset_all_fn(void *opaque)
@@ -348,7 +332,7 @@ void qdev_reset_all_fn(void *opaque)
 
 void qbus_reset_all(BusState *bus)
 {
-    qbus_walk_children(bus, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL);
+    qbus_reset(bus, false);
 }
 
 void qbus_reset_all_fn(void *opaque)
-- 
2.21.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]