summaryrefslogtreecommitdiff
path: root/hw/audio
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-06-06 16:02:26 +0200
committerAndreas Färber <afaerber@suse.de>2013-06-06 16:20:04 +0200
commit11c7549d836b3d3a4ccd903bbfdbdc942b9add52 (patch)
tree542f096aba57bf32328ab17358cc1fe18259f3e9 /hw/audio
parent8819c10b5d55d537d59a0ffd5d623f348fc36c47 (diff)
downloadqemu-11c7549d836b3d3a4ccd903bbfdbdc942b9add52.tar.gz
qemu-11c7549d836b3d3a4ccd903bbfdbdc942b9add52.tar.bz2
qemu-11c7549d836b3d3a4ccd903bbfdbdc942b9add52.zip
gus: QOM'ify some more
Add type constant and cast macro. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/audio')
-rw-r--r--hw/audio/gus.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/audio/gus.c b/hw/audio/gus.c
index a91921c77d..e0aea26216 100644
--- a/hw/audio/gus.c
+++ b/hw/audio/gus.c
@@ -46,6 +46,9 @@
#define IO_WRITE_PROTO(name) \
static void name (void *opaque, uint32_t nport, uint32_t val)
+#define TYPE_GUS "gus"
+#define GUS(obj) OBJECT_CHECK (GUSState, (obj), TYPE_GUS)
+
typedef struct GUSState {
ISADevice dev;
GUSEmuState emu;
@@ -250,7 +253,7 @@ static const MemoryRegionPortio gus_portio_list2[] = {
static int gus_initfn (ISADevice *dev)
{
- GUSState *s = DO_UPCAST (GUSState, dev, dev);
+ GUSState *s = GUS (dev);
struct audsettings as;
AUD_register_card ("gus", &s->card);
@@ -295,7 +298,7 @@ static int gus_initfn (ISADevice *dev)
static int GUS_init (ISABus *bus)
{
- isa_create_simple (bus, "gus");
+ isa_create_simple (bus, TYPE_GUS);
return 0;
}
@@ -318,7 +321,7 @@ static void gus_class_initfn (ObjectClass *klass, void *data)
}
static const TypeInfo gus_info = {
- .name = "gus",
+ .name = TYPE_GUS,
.parent = TYPE_ISA_DEVICE,
.instance_size = sizeof (GUSState),
.class_init = gus_class_initfn,