diff options
author | Andreas Färber <afaerber@suse.de> | 2013-07-26 23:21:50 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-07-29 21:06:59 +0200 |
commit | f1a0a79f4faeac50ea490496e92d00d7260d9437 (patch) | |
tree | 2cf8caba494195c7849aea3b9e473e8e1a355871 /hw/misc/slavio_misc.c | |
parent | 95eb2084f9e59c50cb989ef0e717e0d933bd1480 (diff) |
slavio_misc: QOM cast cleanup for APCState
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/misc/slavio_misc.c')
-rw-r--r-- | hw/misc/slavio_misc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/misc/slavio_misc.c b/hw/misc/slavio_misc.c index 1b93a019f8..767544eca1 100644 --- a/hw/misc/slavio_misc.c +++ b/hw/misc/slavio_misc.c @@ -57,8 +57,12 @@ typedef struct MiscState { uint16_t leds; } MiscState; +#define TYPE_APC "apc" +#define APC(obj) OBJECT_CHECK(APCState, (obj), TYPE_APC) + typedef struct APCState { - SysBusDevice busdev; + SysBusDevice parent_obj; + MemoryRegion iomem; qemu_irq cpu_halt; } APCState; @@ -411,7 +415,7 @@ static const VMStateDescription vmstate_misc = { static int apc_init1(SysBusDevice *dev) { - APCState *s = FROM_SYSBUS(APCState, dev); + APCState *s = APC(dev); sysbus_init_irq(dev, &s->cpu_halt); @@ -498,7 +502,7 @@ static void apc_class_init(ObjectClass *klass, void *data) } static const TypeInfo apc_info = { - .name = "apc", + .name = TYPE_APC, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(MiscState), .class_init = apc_class_init, |