diff options
author | Andreas Färber <afaerber@suse.de> | 2013-04-27 22:18:39 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-29 08:27:47 -0500 |
commit | eb1440e7ec522784f4351bb5e88436cc3cd9abd7 (patch) | |
tree | 1759d99530a6bbd9995694af33804d06f67c9ddd | |
parent | 020c8e7602fc6bf6a6ce62d99fb0a0882877ccd1 (diff) |
i82374: QOM'ify
Introduce type constant and cast macro to obsolete DO_UPCAST().
Prepares for ISA realizefn.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-5-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | hw/dma/i82374.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index 835639d43c..f3d1924109 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -104,8 +104,12 @@ static void i82374_init(I82374State *s) memset(s->commands, 0, sizeof(s->commands)); } +#define TYPE_I82374 "i82374" +#define I82374(obj) OBJECT_CHECK(ISAi82374State, (obj), TYPE_I82374) + typedef struct ISAi82374State { - ISADevice dev; + ISADevice parent_obj; + uint32_t iobase; I82374State state; } ISAi82374State; @@ -122,7 +126,7 @@ static const VMStateDescription vmstate_isa_i82374 = { static int i82374_isa_init(ISADevice *dev) { - ISAi82374State *isa = DO_UPCAST(ISAi82374State, dev, dev); + ISAi82374State *isa = I82374(dev); I82374State *s = &isa->state; register_ioport_read(isa->iobase + 0x0A, 1, 1, i82374_read_isr, s); @@ -154,7 +158,7 @@ static void i82374_class_init(ObjectClass *klass, void *data) } static const TypeInfo i82374_isa_info = { - .name = "i82374", + .name = TYPE_I82374, .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(ISAi82374State), .class_init = i82374_class_init, |