diff options
author | Andreas Färber <afaerber@suse.de> | 2013-07-27 22:19:54 +0200 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2013-07-28 18:57:47 +0200 |
commit | cba5cb67becd66f8eae4177c4f95756f3f9bb77a (patch) | |
tree | 50dedba0728168e5f45374380319eebd2ef5892a | |
parent | 240ce26a0533a6e5ee472789fbfbd9f7f939197e (diff) |
mips_malta: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r-- | hw/mips/mips_malta.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index dad58c0ed2..e932fdc77d 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -79,8 +79,12 @@ typedef struct { SerialState *uart; } MaltaFPGAState; +#define TYPE_MIPS_MALTA "mips-malta" +#define MIPS_MALTA(obj) OBJECT_CHECK(MaltaState, (obj), TYPE_MIPS_MALTA) + typedef struct { - SysBusDevice busdev; + SysBusDevice parent_obj; + qemu_irq *i8259; } MaltaState; @@ -808,8 +812,8 @@ void mips_malta_init(QEMUMachineInitArgs *args) int fl_sectors = bios_size >> 16; int be; - DeviceState *dev = qdev_create(NULL, "mips-malta"); - MaltaState *s = DO_UPCAST(MaltaState, busdev.qdev, dev); + DeviceState *dev = qdev_create(NULL, TYPE_MIPS_MALTA); + MaltaState *s = MIPS_MALTA(dev); qdev_init_nofail(dev); @@ -1004,7 +1008,7 @@ static void mips_malta_class_init(ObjectClass *klass, void *data) } static const TypeInfo mips_malta_device = { - .name = "mips-malta", + .name = TYPE_MIPS_MALTA, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(MaltaState), .class_init = mips_malta_class_init, |