diff options
author | Andreas Färber <afaerber@suse.de> | 2013-01-20 02:47:33 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-01-21 13:52:24 -0600 |
commit | 1356b98d3e95a85071e6bf9a99e8799e1ae1bbee (patch) | |
tree | 26b8c982dec9507ac71f29914dfe09f0cfb9a848 /hw/sun4m.c | |
parent | 6fd8e79af031d8cfc0eb02d40d03281917fcb27b (diff) | |
download | hqemu-1356b98d3e95a85071e6bf9a99e8799e1ae1bbee.zip hqemu-1356b98d3e95a85071e6bf9a99e8799e1ae1bbee.tar.gz |
sysbus: Drop sysbus_from_qdev() cast macro
Replace by SYS_BUS_DEVICE() QOM cast macro using a scripted conversion.
Avoids the old macro creeping into new code.
Resolve a Coding Style warning in openpic code.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <anthony@codemonkey.ws>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/sun4m.c')
-rw-r--r-- | hw/sun4m.c | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -381,7 +381,7 @@ static void *iommu_init(hwaddr addr, uint32_t version, qemu_irq irq) dev = qdev_create(NULL, "iommu"); qdev_prop_set_uint32(dev, "version", version); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); sysbus_connect_irq(s, 0, irq); sysbus_mmio_map(s, 0, addr); @@ -398,7 +398,7 @@ static void *sparc32_dma_init(hwaddr daddr, qemu_irq parent_irq, qdev_prop_set_ptr(dev, "iommu_opaque", iommu); qdev_prop_set_uint32(dev, "is_ledma", is_ledma); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); sysbus_connect_irq(s, 0, parent_irq); *dev_irq = qdev_get_gpio_in(dev, 0); sysbus_mmio_map(s, 0, daddr); @@ -419,7 +419,7 @@ static void lance_init(NICInfo *nd, hwaddr leaddr, qdev_set_nic_properties(dev, nd); qdev_prop_set_ptr(dev, "dma", dma_opaque); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); sysbus_mmio_map(s, 0, leaddr); sysbus_connect_irq(s, 0, irq); reset = qdev_get_gpio_in(dev, 0); @@ -437,7 +437,7 @@ static DeviceState *slavio_intctl_init(hwaddr addr, dev = qdev_create(NULL, "slavio_intctl"); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); for (i = 0; i < MAX_CPUS; i++) { for (j = 0; j < MAX_PILS; j++) { @@ -465,7 +465,7 @@ static void slavio_timer_init_all(hwaddr addr, qemu_irq master_irq, dev = qdev_create(NULL, "slavio_timer"); qdev_prop_set_uint32(dev, "num_cpus", num_cpus); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); sysbus_connect_irq(s, 0, master_irq); sysbus_mmio_map(s, 0, addr + SYS_TIMER_OFFSET); @@ -502,7 +502,7 @@ static void slavio_misc_init(hwaddr base, dev = qdev_create(NULL, "slavio_misc"); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); if (base) { /* 8 bit registers */ /* Slavio control */ @@ -540,7 +540,7 @@ static void ecc_init(hwaddr base, qemu_irq irq, uint32_t version) dev = qdev_create(NULL, "eccmemctl"); qdev_prop_set_uint32(dev, "version", version); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); sysbus_connect_irq(s, 0, irq); sysbus_mmio_map(s, 0, base); if (version == 0) { // SS-600MP only @@ -555,7 +555,7 @@ static void apc_init(hwaddr power_base, qemu_irq cpu_halt) dev = qdev_create(NULL, "apc"); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); /* Power management (APC) XXX: not a Slavio device */ sysbus_mmio_map(s, 0, power_base); sysbus_connect_irq(s, 0, cpu_halt); @@ -574,7 +574,7 @@ static void tcx_init(hwaddr addr, int vram_size, int width, qdev_prop_set_uint16(dev, "height", height); qdev_prop_set_uint16(dev, "depth", depth); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); /* 8-bit plane */ sysbus_mmio_map(s, 0, addr + 0x00800000ULL); /* DAC */ @@ -604,7 +604,7 @@ static void idreg_init(hwaddr addr) dev = qdev_create(NULL, "macio_idreg"); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); sysbus_mmio_map(s, 0, addr); cpu_physical_memory_write_rom(addr, idreg_data, sizeof(idreg_data)); @@ -653,7 +653,7 @@ static void afx_init(hwaddr addr) dev = qdev_create(NULL, "tcx_afx"); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); sysbus_mmio_map(s, 0, addr); } @@ -703,7 +703,7 @@ static void prom_init(hwaddr addr, const char *bios_name) dev = qdev_create(NULL, "openprom"); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); sysbus_mmio_map(s, 0, addr); @@ -793,7 +793,7 @@ static void ram_init(hwaddr addr, ram_addr_t RAM_size, exit(1); } dev = qdev_create(NULL, "memory"); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); d = FROM_SYSBUS(RamDevice, s); d->size = RAM_size; @@ -1560,7 +1560,7 @@ static DeviceState *sbi_init(hwaddr addr, qemu_irq **parent_irq) dev = qdev_create(NULL, "sbi"); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); for (i = 0; i < MAX_CPUS; i++) { sysbus_connect_irq(s, i, *parent_irq[i]); @@ -1761,7 +1761,7 @@ static DeviceState *sun4c_intctl_init(hwaddr addr, dev = qdev_create(NULL, "sun4c_intctl"); qdev_init_nofail(dev); - s = sysbus_from_qdev(dev); + s = SYS_BUS_DEVICE(dev); for (i = 0; i < MAX_PILS; i++) { sysbus_connect_irq(s, i, parent_irq[i]); |