[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 101/173] puv3_intc: QOM cast cleanup
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 101/173] puv3_intc: QOM cast cleanup |
Date: |
Mon, 29 Jul 2013 21:19:18 +0200 |
Signed-off-by: Andreas Färber <address@hidden>
---
hw/intc/puv3_intc.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/hw/intc/puv3_intc.c b/hw/intc/puv3_intc.c
index 44b6651..c2803d0 100644
--- a/hw/intc/puv3_intc.c
+++ b/hw/intc/puv3_intc.c
@@ -13,8 +13,12 @@
#undef DEBUG_PUV3
#include "hw/unicore32/puv3.h"
-typedef struct {
- SysBusDevice busdev;
+#define TYPE_PUV3_INTC "puv3_intc"
+#define PUV3_INTC(obj) OBJECT_CHECK(PUV3INTCState, (obj), TYPE_PUV3_INTC)
+
+typedef struct PUV3INTCState {
+ SysBusDevice parent_obj;
+
MemoryRegion iomem;
qemu_irq parent_irq;
@@ -96,19 +100,20 @@ static const MemoryRegionOps puv3_intc_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-static int puv3_intc_init(SysBusDevice *dev)
+static int puv3_intc_init(SysBusDevice *sbd)
{
- PUV3INTCState *s = FROM_SYSBUS(PUV3INTCState, dev);
+ DeviceState *dev = DEVICE(sbd);
+ PUV3INTCState *s = PUV3_INTC(dev);
- qdev_init_gpio_in(&s->busdev.qdev, puv3_intc_handler, PUV3_IRQS_NR);
- sysbus_init_irq(&s->busdev, &s->parent_irq);
+ qdev_init_gpio_in(dev, puv3_intc_handler, PUV3_IRQS_NR);
+ sysbus_init_irq(sbd, &s->parent_irq);
s->reg_ICMR = 0;
s->reg_ICPR = 0;
memory_region_init_io(&s->iomem, OBJECT(s), &puv3_intc_ops, s, "puv3_intc",
- PUV3_REGS_OFFSET);
- sysbus_init_mmio(dev, &s->iomem);
+ PUV3_REGS_OFFSET);
+ sysbus_init_mmio(sbd, &s->iomem);
return 0;
}
@@ -121,7 +126,7 @@ static void puv3_intc_class_init(ObjectClass *klass, void
*data)
}
static const TypeInfo puv3_intc_info = {
- .name = "puv3_intc",
+ .name = TYPE_PUV3_INTC,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(PUV3INTCState),
.class_init = puv3_intc_class_init,
--
1.8.1.4
- [Qemu-devel] [PULL 103/173] slavio_intctl: QOM cast cleanup, (continued)
- [Qemu-devel] [PULL 103/173] slavio_intctl: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 099/173] pl190: Rename pl190_state to PL190State, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 173/173] sysbus: QOM parent field cleanup for SysBusDevice, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 169/173] kvmvapic: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 168/173] mipsnet: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 118/173] cadence_gem: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 171/173] ioapic: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 122/173] lance: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 170/173] kvm/ioapic: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 100/173] pl190: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 101/173] puv3_intc: QOM cast cleanup,
Andreas Färber <=
- [Qemu-devel] [PULL 117/173] zynq_slcr: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 166/173] exynos4210_i2c: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 102/173] realview_gic: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 120/173] etraxfs_eth: Rename fs_eth to ETRAXFSEthState, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 104/173] xilinx_intc: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 098/173] omap_intc: QOM'ify omap-intc and omap2-intc, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 121/173] lan9118: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 167/173] opencores_eth: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 119/173] etraxfs_eth: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 172/173] spapr_pci: QOM cast cleanup, Andreas Färber, 2013/07/29