diff options
author | Andreas Färber <afaerber@suse.de> | 2013-04-27 22:18:49 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-29 08:27:48 -0500 |
commit | 399f05a6e181c07611a93ac73025605cf24c4a6c (patch) | |
tree | d008f0111cc6672fd132d20abd6e02b1e367865c | |
parent | d367ece5e51d4f48687813eb5fe8d2a0e2e728d2 (diff) |
sb16: 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-15-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | hw/audio/sb16.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 783b6b4351..61583bc6fd 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -47,8 +47,12 @@ static const char e3[] = "COPYRIGHT (C) CREATIVE TECHNOLOGY LTD, 1992."; +#define TYPE_SB16 "sb16" +#define SB16(obj) OBJECT_CHECK (SB16State, (obj), TYPE_SB16) + typedef struct SB16State { - ISADevice dev; + ISADevice parent_obj; + QEMUSoundCard card; qemu_irq pic; uint32_t irq; @@ -1354,9 +1358,7 @@ static const MemoryRegionPortio sb16_ioport_list[] = { static int sb16_initfn (ISADevice *dev) { - SB16State *s; - - s = DO_UPCAST (SB16State, dev, dev); + SB16State *s = SB16 (dev); s->cmd = -1; isa_init_irq (dev, &s->pic, s->irq); @@ -1386,7 +1388,7 @@ static int sb16_initfn (ISADevice *dev) int SB16_init (ISABus *bus) { - isa_create_simple (bus, "sb16"); + isa_create_simple (bus, TYPE_SB16); return 0; } @@ -1410,7 +1412,7 @@ static void sb16_class_initfn (ObjectClass *klass, void *data) } static const TypeInfo sb16_info = { - .name = "sb16", + .name = TYPE_SB16, .parent = TYPE_ISA_DEVICE, .instance_size = sizeof (SB16State), .class_init = sb16_class_initfn, |