From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Vassili Karpov (malc)" <av1474@comtv.ru>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH qom-next for-1.6 3/4] milkymist-ac97: QOM'ify
Date: Wed, 24 Jul 2013 10:35:53 +0200 [thread overview]
Message-ID: <1374654954-30128-4-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1374654954-30128-1-git-send-email-afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/audio/milkymist-ac97.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/hw/audio/milkymist-ac97.c b/hw/audio/milkymist-ac97.c
index 133de4e..9c0f7a0 100644
--- a/hw/audio/milkymist-ac97.c
+++ b/hw/audio/milkymist-ac97.c
@@ -51,8 +51,13 @@ enum {
CTRL_EN = (1<<0),
};
+#define TYPE_MILKYMIST_AC97 "milkymist-ac97"
+#define MILKYMIST_AC97(obj) \
+ OBJECT_CHECK(MilkymistAC97State, (obj), TYPE_MILKYMIST_AC97)
+
struct MilkymistAC97State {
- SysBusDevice busdev;
+ SysBusDevice parent_obj;
+
MemoryRegion regs_region;
QEMUSoundCard card;
@@ -258,7 +263,7 @@ static void ac97_out_cb(void *opaque, int free_b)
static void milkymist_ac97_reset(DeviceState *d)
{
- MilkymistAC97State *s = container_of(d, MilkymistAC97State, busdev.qdev);
+ MilkymistAC97State *s = MILKYMIST_AC97(d);
int i;
for (i = 0; i < R_MAX; i++) {
@@ -280,7 +285,7 @@ static int ac97_post_load(void *opaque, int version_id)
static int milkymist_ac97_init(SysBusDevice *dev)
{
- MilkymistAC97State *s = FROM_SYSBUS(typeof(*s), dev);
+ MilkymistAC97State *s = MILKYMIST_AC97(dev);
struct audsettings as;
sysbus_init_irq(dev, &s->crrequest_irq);
@@ -330,7 +335,7 @@ static void milkymist_ac97_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo milkymist_ac97_info = {
- .name = "milkymist-ac97",
+ .name = TYPE_MILKYMIST_AC97,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(MilkymistAC97State),
.class_init = milkymist_ac97_class_init,
--
1.8.1.4
next prev parent reply other threads:[~2013-07-24 8:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-24 8:35 [Qemu-devel] [PATCH qom-next for-1.6 0/4] audio: QOM cast cleanups Andreas Färber
2013-07-24 8:35 ` [Qemu-devel] [PATCH qom-next for-1.6 1/4] cs4231: QOM'ify Andreas Färber
2013-07-26 8:51 ` Hu Tao
2013-07-24 8:35 ` [Qemu-devel] [PATCH qom-next for-1.6 2/4] audio/marvell_88w8618: QOM'ify Andreas Färber
2013-07-26 8:52 ` Hu Tao
2013-07-24 8:35 ` Andreas Färber [this message]
2013-07-26 8:52 ` [Qemu-devel] [PATCH qom-next for-1.6 3/4] milkymist-ac97: QOM'ify Hu Tao
2013-07-24 8:35 ` [Qemu-devel] [PATCH qom-next for-1.6 4/4] pl041: QOM'ify Andreas Färber
2013-07-26 8:52 ` Hu Tao
2013-07-27 17:53 ` Andreas Färber
2013-07-26 23:08 ` [Qemu-devel] [PATCH qom-next for-1.6 0/4] audio: QOM cast cleanups Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1374654954-30128-4-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=av1474@comtv.ru \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).