diff options
author | Andreas Färber | 2013-07-26 16:58:49 +0200 |
---|---|---|
committer | Andreas Färber | 2013-07-29 21:06:46 +0200 |
commit | 049e7d226e08bbf50c17ffdc3a6793c6e45e77f2 (patch) | |
tree | b89c33312b116915592b99139cd22217ed1584d7 /hw/dma | |
parent | sparc32_dma: QOM cast cleanup (diff) | |
download | qemu-049e7d226e08bbf50c17ffdc3a6793c6e45e77f2.tar.gz qemu-049e7d226e08bbf50c17ffdc3a6793c6e45e77f2.tar.xz qemu-049e7d226e08bbf50c17ffdc3a6793c6e45e77f2.zip |
sun4m_iommu: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/dma')
-rw-r--r-- | hw/dma/sun4m_iommu.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/dma/sun4m_iommu.c b/hw/dma/sun4m_iommu.c index edb93f36ac..a04409a273 100644 --- a/hw/dma/sun4m_iommu.c +++ b/hw/dma/sun4m_iommu.c @@ -126,8 +126,12 @@ #define IOMMU_PAGE_SIZE (1 << IOMMU_PAGE_SHIFT) #define IOMMU_PAGE_MASK ~(IOMMU_PAGE_SIZE - 1) +#define TYPE_SUN4M_IOMMU "iommu" +#define SUN4M_IOMMU(obj) OBJECT_CHECK(IOMMUState, (obj), TYPE_SUN4M_IOMMU) + typedef struct IOMMUState { - SysBusDevice busdev; + SysBusDevice parent_obj; + MemoryRegion iomem; uint32_t regs[IOMMU_NREGS]; hwaddr iostart; @@ -332,7 +336,7 @@ static const VMStateDescription vmstate_iommu = { static void iommu_reset(DeviceState *d) { - IOMMUState *s = container_of(d, IOMMUState, busdev.qdev); + IOMMUState *s = SUN4M_IOMMU(d); memset(s->regs, 0, IOMMU_NREGS * 4); s->iostart = 0; @@ -345,7 +349,7 @@ static void iommu_reset(DeviceState *d) static int iommu_init1(SysBusDevice *dev) { - IOMMUState *s = FROM_SYSBUS(IOMMUState, dev); + IOMMUState *s = SUN4M_IOMMU(dev); sysbus_init_irq(dev, &s->irq); @@ -373,7 +377,7 @@ static void iommu_class_init(ObjectClass *klass, void *data) } static const TypeInfo iommu_info = { - .name = "iommu", + .name = TYPE_SUN4M_IOMMU, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(IOMMUState), .class_init = iommu_class_init, |