[PATCH for-8.0 9/9] hw: Remove device_legacy_reset()

Peter Maydell posted 9 patches 3 years, 3 months ago
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>, Stefano Stabellini <sstabellini@kernel.org>, Anthony Perard <anthony.perard@citrix.com>, Paul Durrant <paul@xen.org>, Richard Henderson <richard.henderson@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Elena Ufimtseva <elena.ufimtseva@oracle.com>, Jagannathan Raman <jag.raman@oracle.com>, John G Johnson <john.g.johnson@oracle.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Thomas Huth <thuth@redhat.com>
[PATCH for-8.0 9/9] hw: Remove device_legacy_reset()
Posted by Peter Maydell 3 years, 3 months ago
The device_legacy_reset() function is now not used anywhere, so we
can remove the implementation.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 include/hw/qdev-core.h |  9 ---------
 hw/core/qdev.c         | 10 ----------
 2 files changed, 19 deletions(-)

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index c7eda169d78..35fddb19a64 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -776,15 +776,6 @@ BusState *sysbus_get_default(void);
 char *qdev_get_fw_dev_path(DeviceState *dev);
 char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *dev);
 
-/**
- * device_legacy_reset:
- *
- * Reset a single device (by calling the reset method).
- * Note: This function is deprecated and will be removed when it becomes unused.
- * Please use device_cold_reset() now.
- */
-void device_legacy_reset(DeviceState *dev);
-
 void device_class_set_props(DeviceClass *dc, Property *props);
 
 /**
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 3b0f04c5c6d..2743191efe7 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -857,16 +857,6 @@ void device_class_set_parent_unrealize(DeviceClass *dc,
     dc->unrealize = dev_unrealize;
 }
 
-void device_legacy_reset(DeviceState *dev)
-{
-    DeviceClass *klass = DEVICE_GET_CLASS(dev);
-
-    trace_qdev_reset(dev, object_get_typename(OBJECT(dev)));
-    if (klass->reset) {
-        klass->reset(dev);
-    }
-}
-
 Object *qdev_get_machine(void)
 {
     static Object *dev;
-- 
2.25.1
Re: [PATCH for-8.0 9/9] hw: Remove device_legacy_reset()
Posted by Philippe Mathieu-Daudé 3 years, 3 months ago
On 4/11/22 17:15, Peter Maydell wrote:
> The device_legacy_reset() function is now not used anywhere, so we
> can remove the implementation.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   include/hw/qdev-core.h |  9 ---------
>   hw/core/qdev.c         | 10 ----------
>   2 files changed, 19 deletions(-)

> -void device_legacy_reset(DeviceState *dev)
> -{
> -    DeviceClass *klass = DEVICE_GET_CLASS(dev);
> -
> -    trace_qdev_reset(dev, object_get_typename(OBJECT(dev)));

We can remove the "qdev_reset" entry in hw/core/trace-events.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

> -    if (klass->reset) {
> -        klass->reset(dev);
> -    }
> -}