[RFC PATCH v2 086/137] pci: 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 their PCI devices with an explicit QOM parent
now.  Drop pci_new_orphan(), pci_new_multifunction_orphan(),
pci_create_simple_orphan(), pci_create_simple_multifunction_orphan()
and the internal pci_new_internal() they wrapped.

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

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index ca5882ba59..5ef9dfa8b7 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2388,16 +2388,6 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp)
     pci_dev->msi_trigger = pci_msi_trigger;
 }
 
-static PCIDevice *pci_new_internal(int devfn, bool multifunction,
-                                   const char *name)
-{
-    DeviceState *dev;
-
-    dev = qdev_new_orphan(name);
-    qdev_prop_set_int32(dev, "addr", devfn);
-    qdev_prop_set_bit(dev, "multifunction", multifunction);
-    return PCI_DEVICE(dev);
-}
 
 static PCIDevice *pci_new_child_internal(Object *parent, const char *id,
                                           int devfn, bool multifunction,
@@ -2440,36 +2430,11 @@ PCIDevice *pci_create_simple(Object *parent, const char *id,
     return dev;
 }
 
-PCIDevice *pci_new_multifunction_orphan(int devfn, const char *name)
-{
-    return pci_new_internal(devfn, true, name);
-}
-
-PCIDevice *pci_new_orphan(int devfn, const char *name)
-{
-    return pci_new_internal(devfn, false, name);
-}
-
 bool pci_realize_and_unref(PCIDevice *dev, PCIBus *bus, Error **errp)
 {
     return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp);
 }
 
-PCIDevice *pci_create_simple_multifunction_orphan(PCIBus *bus, int devfn,
-                                           const char *name)
-{
-    PCIDevice *dev = pci_new_multifunction_orphan(devfn, name);
-    pci_realize_and_unref(dev, bus, &error_fatal);
-    return dev;
-}
-
-PCIDevice *pci_create_simple_orphan(PCIBus *bus, int devfn, const char *name)
-{
-    PCIDevice *dev = pci_new_orphan(devfn, name);
-    pci_realize_and_unref(dev, bus, &error_fatal);
-    return dev;
-}
-
 static uint8_t pci_find_space(PCIDevice *pdev, uint8_t size)
 {
     int offset = PCI_CONFIG_HEADER_SIZE;
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index 9c6bcc0b96..d6191fc529 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -1098,13 +1098,8 @@ PCIDevice *pci_create_simple_multifunction(Object *parent, const char *id,
 PCIDevice *pci_create_simple(Object *parent, const char *id,
                              PCIBus *bus, int devfn, const char *type);
 
-PCIDevice *pci_new_multifunction_orphan(int devfn, const char *name);
-PCIDevice *pci_new_orphan(int devfn, const char *name);
 bool pci_realize_and_unref(PCIDevice *dev, PCIBus *bus, Error **errp);
 
-PCIDevice *pci_create_simple_multifunction_orphan(PCIBus *bus, int devfn,
-                                           const char *name);
-PCIDevice *pci_create_simple_orphan(PCIBus *bus, int devfn, const char *name);
 
 void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_dev);
 
-- 
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.