diff mbox

[02/13] pci: Fold pci_bus_new_inplace into pci_bus_new

Message ID 92b5d288d765abe16a47b8fea65db9133c9cc644.1338799935.git.jan.kiszka@siemens.com
State New
Headers show

Commit Message

Jan Kiszka June 4, 2012, 8:52 a.m. UTC
There are no external users for this function.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/pci.c |   29 +++++++++++------------------
 hw/pci.h |    5 -----
 2 files changed, 11 insertions(+), 23 deletions(-)

Comments

Andreas Färber June 7, 2012, 12:51 p.m. UTC | #1
Am 04.06.2012 10:52, schrieb Jan Kiszka:
> There are no external users for this function.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Nack, please take a look at my recent prep_pci RFC series. Instead of
dropping _inplace we need to convert all PCI host controllers to
initialize the bus in-place for the QOM realize model to work.

Andreas
Jan Kiszka June 7, 2012, 3:07 p.m. UTC | #2
On 2012-06-07 14:51, Andreas Färber wrote:
> Am 04.06.2012 10:52, schrieb Jan Kiszka:
>> There are no external users for this function.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Nack, please take a look at my recent prep_pci RFC series. Instead of
> dropping _inplace we need to convert all PCI host controllers to
> initialize the bus in-place for the QOM realize model to work.

No problem, I can drop this patch. Was just an observation based on the
in-tree history.

Jan
diff mbox

Patch

diff --git a/hw/pci.c b/hw/pci.c
index 893f89c..33452ab 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -259,36 +259,29 @@  int pci_find_domain(const PCIBus *bus)
     return -1;
 }
 
-void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent,
-                         const char *name,
-                         MemoryRegion *address_space_mem,
-                         MemoryRegion *address_space_io,
-                         uint8_t devfn_min)
+PCIBus *pci_bus_new(DeviceState *parent, const char *name,
+                    MemoryRegion *address_space_mem,
+                    MemoryRegion *address_space_io,
+                    uint8_t devfn_min)
 {
-    qbus_create_inplace(&bus->qbus, &pci_bus_info, parent, name);
+    PCIBus *bus;
+
+    bus = g_malloc0(sizeof(*bus));
+    bus->qbus.qdev_allocated = 1;
+
     assert(PCI_FUNC(devfn_min) == 0);
     bus->devfn_min = devfn_min;
     bus->address_space_mem = address_space_mem;
     bus->address_space_io = address_space_io;
 
+    qbus_create_inplace(&bus->qbus, &pci_bus_info, parent, name);
+
     /* host bridge */
     QLIST_INIT(&bus->child);
     pci_host_bus_register(0, bus); /* for now only pci domain 0 is supported */
 
     vmstate_register(NULL, -1, &vmstate_pcibus, bus);
-}
-
-PCIBus *pci_bus_new(DeviceState *parent, const char *name,
-                    MemoryRegion *address_space_mem,
-                    MemoryRegion *address_space_io,
-                    uint8_t devfn_min)
-{
-    PCIBus *bus;
 
-    bus = g_malloc0(sizeof(*bus));
-    bus->qbus.qdev_allocated = 1;
-    pci_bus_new_inplace(bus, parent, name, address_space_mem,
-                        address_space_io, devfn_min);
     return bus;
 }
 
diff --git a/hw/pci.h b/hw/pci.h
index c3cacce..7eaf90b 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -285,11 +285,6 @@  typedef enum {
 
 typedef int (*pci_hotplug_fn)(DeviceState *qdev, PCIDevice *pci_dev,
                               PCIHotplugState state);
-void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent,
-                         const char *name,
-                         MemoryRegion *address_space_mem,
-                         MemoryRegion *address_space_io,
-                         uint8_t devfn_min);
 PCIBus *pci_bus_new(DeviceState *parent, const char *name,
                     MemoryRegion *address_space_mem,
                     MemoryRegion *address_space_io,