[RFC PATCH v2 088/137] sysbus: Remove *_orphan() creator variants

Alexander Graf <[email protected]>
Newsgroups org.nongnu.qemu-arm,org.nongnu.qemu-devel,org.nongnu.qemu-riscv
Message-ID <[email protected]>
All boards create sysbus devices with an explicit parent now.
Drop sysbus_create_simple_orphan() and
sysbus_create_varargs_orphan().

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
AI-used-for: code (refactoring)
Signed-off-by: Alexander Graf <[email protected]>
---
 hw/core/sysbus.c         | 29 -----------------------------
 include/hw/core/sysbus.h | 11 -----------
 2 files changed, 40 deletions(-)

diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index 85f56b68fb..1c67ea3580 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -250,35 +250,6 @@ DeviceState *sysbus_create_varargs(Object *parent, const char *id,
     return dev;
 }
 
-DeviceState *sysbus_create_varargs_orphan(const char *name,
-                                   hwaddr addr, ...)
-{
-    DeviceState *dev;
-    SysBusDevice *s;
-    va_list va;
-    qemu_irq irq;
-    int n;
-
-    dev = qdev_new_orphan(name);
-    s = SYS_BUS_DEVICE(dev);
-    sysbus_realize_and_unref(s, &error_fatal);
-    if (addr != (hwaddr)-1) {
-        sysbus_mmio_map(s, 0, addr);
-    }
-    va_start(va, addr);
-    n = 0;
-    while (1) {
-        irq = va_arg(va, qemu_irq);
-        if (!irq) {
-            break;
-        }
-        sysbus_connect_irq(s, n, irq);
-        n++;
-    }
-    va_end(va);
-    return dev;
-}
-
 bool sysbus_realize(SysBusDevice *dev, Error **errp)
 {
     return qdev_realize(DEVICE(dev), sysbus_get_default(), errp);
diff --git a/include/hw/core/sysbus.h b/include/hw/core/sysbus.h
index 1e07b1978d..ef3d39f576 100644
--- a/include/hw/core/sysbus.h
+++ b/include/hw/core/sysbus.h
@@ -119,15 +119,4 @@ static inline DeviceState *sysbus_create_simple(Object *parent,
     return sysbus_create_varargs(parent, id, type, addr, irq, NULL);
 }
 
-/* Legacy helper function for creating unparented devices.  */
-DeviceState *sysbus_create_varargs_orphan(const char *name,
-                                 hwaddr addr, ...);
-
-static inline DeviceState *sysbus_create_simple_orphan(const char *name,
-                                              hwaddr addr,
-                                              qemu_irq irq)
-{
-    return sysbus_create_varargs_orphan(name, addr, irq, NULL);
-}
-
 #endif /* HW_SYSBUS_H */
-- 
2.47.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.