mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
pci-bridge: Turn PCIBridge into abstract QOM type
Introduce TYPE_PCI_BRIDGE as base type and use PCI_BRIDGE() casts. Reviewed-by: Don Koch <dkoch@verizon.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> [AF: Updated pbm-bridge parent to TYPE_PCI_BRIDGE] Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
45c0a675f9
commit
f055e96bd4
11 changed files with 78 additions and 55 deletions
|
@ -423,7 +423,7 @@ PCIBus *pci_apb_init(hwaddr special_base,
|
|||
/* APB secondary busses */
|
||||
pci_dev = pci_create_multifunction(phb->bus, PCI_DEVFN(1, 0), true,
|
||||
"pbm-bridge");
|
||||
br = DO_UPCAST(PCIBridge, dev, pci_dev);
|
||||
br = PCI_BRIDGE(pci_dev);
|
||||
pci_bridge_map_irq(br, "Advanced PCI Bus secondary bridge 1",
|
||||
pci_apb_map_irq);
|
||||
qdev_init_nofail(&pci_dev->qdev);
|
||||
|
@ -431,7 +431,7 @@ PCIBus *pci_apb_init(hwaddr special_base,
|
|||
|
||||
pci_dev = pci_create_multifunction(phb->bus, PCI_DEVFN(1, 1), true,
|
||||
"pbm-bridge");
|
||||
br = DO_UPCAST(PCIBridge, dev, pci_dev);
|
||||
br = PCI_BRIDGE(pci_dev);
|
||||
pci_bridge_map_irq(br, "Advanced PCI Bus secondary bridge 2",
|
||||
pci_apb_map_irq);
|
||||
qdev_init_nofail(&pci_dev->qdev);
|
||||
|
@ -566,8 +566,7 @@ static void pbm_pci_bridge_class_init(ObjectClass *klass, void *data)
|
|||
|
||||
static const TypeInfo pbm_pci_bridge_info = {
|
||||
.name = "pbm-bridge",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIBridge),
|
||||
.parent = TYPE_PCI_BRIDGE,
|
||||
.class_init = pbm_pci_bridge_class_init,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue