diff options
author | Andreas Färber <afaerber@suse.de> | 2012-01-19 07:40:17 +0000 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:49 -0600 |
commit | ff452aceafc7ba4aefb8dcf5542f5ba4f32b3e44 (patch) | |
tree | 1038ec9be1af3758780942a554af5916d5b1d396 /hw/unin_pci.c | |
parent | 70f9c98744d92d89c9f67b5100edc7415b7316fc (diff) |
unin_pci: Drop duplicate busdev
PCIHostState already has a busdev.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/unin_pci.c')
-rw-r--r-- | hw/unin_pci.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/hw/unin_pci.c b/hw/unin_pci.c index be0e98cf09..8c03cb0374 100644 --- a/hw/unin_pci.c +++ b/hw/unin_pci.c @@ -39,7 +39,6 @@ static const int unin_irq_line[] = { 0x1b, 0x1c, 0x1d, 0x1e }; typedef struct UNINState { - SysBusDevice busdev; PCIHostState host_state; MemoryRegion pci_mmio; MemoryRegion pci_hole; @@ -134,11 +133,13 @@ static const MemoryRegionOps unin_data_ops = { static int pci_unin_main_init_device(SysBusDevice *dev) { + PCIHostState *h; UNINState *s; /* Use values found on a real PowerMac */ /* Uninorth main bus */ - s = FROM_SYSBUS(UNINState, dev); + h = FROM_SYSBUS(PCIHostState, dev); + s = DO_UPCAST(UNINState, host_state, h); memory_region_init_io(&s->host_state.conf_mem, &pci_host_conf_le_ops, &s->host_state, "pci-conf-idx", 0x1000); @@ -154,10 +155,12 @@ static int pci_unin_main_init_device(SysBusDevice *dev) static int pci_u3_agp_init_device(SysBusDevice *dev) { + PCIHostState *h; UNINState *s; /* Uninorth U3 AGP bus */ - s = FROM_SYSBUS(UNINState, dev); + h = FROM_SYSBUS(PCIHostState, dev); + s = DO_UPCAST(UNINState, host_state, h); memory_region_init_io(&s->host_state.conf_mem, &pci_host_conf_le_ops, &s->host_state, "pci-conf-idx", 0x1000); @@ -173,10 +176,12 @@ static int pci_u3_agp_init_device(SysBusDevice *dev) static int pci_unin_agp_init_device(SysBusDevice *dev) { + PCIHostState *h; UNINState *s; /* Uninorth AGP bus */ - s = FROM_SYSBUS(UNINState, dev); + h = FROM_SYSBUS(PCIHostState, dev); + s = DO_UPCAST(UNINState, host_state, h); memory_region_init_io(&s->host_state.conf_mem, &pci_host_conf_le_ops, &s->host_state, "pci-conf-idx", 0x1000); @@ -189,10 +194,12 @@ static int pci_unin_agp_init_device(SysBusDevice *dev) static int pci_unin_internal_init_device(SysBusDevice *dev) { + PCIHostState *h; UNINState *s; /* Uninorth internal bus */ - s = FROM_SYSBUS(UNINState, dev); + h = FROM_SYSBUS(PCIHostState, dev); + s = DO_UPCAST(UNINState, host_state, h); memory_region_init_io(&s->host_state.conf_mem, &pci_host_conf_le_ops, &s->host_state, "pci-conf-idx", 0x1000); @@ -209,6 +216,7 @@ PCIBus *pci_pmac_init(qemu_irq *pic, { DeviceState *dev; SysBusDevice *s; + PCIHostState *h; UNINState *d; /* Use values found on a real PowerMac */ @@ -216,14 +224,15 @@ PCIBus *pci_pmac_init(qemu_irq *pic, dev = qdev_create(NULL, "uni-north-pci-pcihost"); qdev_init_nofail(dev); s = sysbus_from_qdev(dev); - d = FROM_SYSBUS(UNINState, s); + h = FROM_SYSBUS(PCIHostState, s); + d = DO_UPCAST(UNINState, host_state, h); memory_region_init(&d->pci_mmio, "pci-mmio", 0x100000000ULL); memory_region_init_alias(&d->pci_hole, "pci-hole", &d->pci_mmio, 0x80000000ULL, 0x70000000ULL); memory_region_add_subregion(address_space_mem, 0x80000000ULL, &d->pci_hole); - d->host_state.bus = pci_register_bus(&d->busdev.qdev, "pci", + d->host_state.bus = pci_register_bus(dev, "pci", pci_unin_set_irq, pci_unin_map_irq, pic, &d->pci_mmio, @@ -272,6 +281,7 @@ PCIBus *pci_pmac_u3_init(qemu_irq *pic, { DeviceState *dev; SysBusDevice *s; + PCIHostState *h; UNINState *d; /* Uninorth AGP bus */ @@ -279,7 +289,8 @@ PCIBus *pci_pmac_u3_init(qemu_irq *pic, dev = qdev_create(NULL, "u3-agp-pcihost"); qdev_init_nofail(dev); s = sysbus_from_qdev(dev); - d = FROM_SYSBUS(UNINState, s); + h = FROM_SYSBUS(PCIHostState, s); + d = DO_UPCAST(UNINState, host_state, h); memory_region_init(&d->pci_mmio, "pci-mmio", 0x100000000ULL); memory_region_init_alias(&d->pci_hole, "pci-hole", &d->pci_mmio, @@ -287,7 +298,7 @@ PCIBus *pci_pmac_u3_init(qemu_irq *pic, memory_region_add_subregion(address_space_mem, 0x80000000ULL, &d->pci_hole); - d->host_state.bus = pci_register_bus(&d->busdev.qdev, "pci", + d->host_state.bus = pci_register_bus(dev, "pci", pci_unin_set_irq, pci_unin_map_irq, pic, &d->pci_mmio, |