From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: xiaoqiang zhao <zxq_yx_007@163.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 2/5] hw/audio: QOM'ify cs4231.c
Date: Mon, 6 Jun 2016 09:02:56 +0200 [thread overview]
Message-ID: <1465196579-26804-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1465196579-26804-1-git-send-email-kraxel@redhat.com>
From: xiaoqiang zhao <zxq_yx_007@163.com>
Drop the old SysBus init function and use instance_init
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
Message-id: 1463111220-30335-2-git-send-email-zxq_yx_007@163.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/audio/cs4231.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/hw/audio/cs4231.c b/hw/audio/cs4231.c
index caf97c1..30690f9 100644
--- a/hw/audio/cs4231.c
+++ b/hw/audio/cs4231.c
@@ -145,16 +145,15 @@ static const VMStateDescription vmstate_cs4231 = {
}
};
-static int cs4231_init1(SysBusDevice *dev)
+static void cs4231_init(Object *obj)
{
- CSState *s = CS4231(dev);
+ CSState *s = CS4231(obj);
+ SysBusDevice *dev = SYS_BUS_DEVICE(obj);
- memory_region_init_io(&s->iomem, OBJECT(s), &cs_mem_ops, s, "cs4321",
+ memory_region_init_io(&s->iomem, obj, &cs_mem_ops, s, "cs4321",
CS_SIZE);
sysbus_init_mmio(dev, &s->iomem);
sysbus_init_irq(dev, &s->irq);
-
- return 0;
}
static Property cs4231_properties[] = {
@@ -164,9 +163,7 @@ static Property cs4231_properties[] = {
static void cs4231_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
- SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
- k->init = cs4231_init1;
dc->reset = cs_reset;
dc->vmsd = &vmstate_cs4231;
dc->props = cs4231_properties;
@@ -176,6 +173,7 @@ static const TypeInfo cs4231_info = {
.name = TYPE_CS4231,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(CSState),
+ .instance_init = cs4231_init,
.class_init = cs4231_class_init,
};
--
1.8.3.1
next prev parent reply other threads:[~2016-06-06 7:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 7:02 [Qemu-devel] [PULL 0/5] audio patch queue Gerd Hoffmann
2016-06-06 7:02 ` [Qemu-devel] [PULL 1/5] audio: pa: Set volume of recording stream instead of recording device Gerd Hoffmann
2016-06-06 7:02 ` Gerd Hoffmann [this message]
2016-06-06 7:02 ` [Qemu-devel] [PULL 3/5] hw/audio: QOM cleanup for intel-hda Gerd Hoffmann
2016-06-06 7:02 ` [Qemu-devel] [PULL 4/5] hw/audio: QOM'ify intel-hda Gerd Hoffmann
2016-06-06 7:02 ` [Qemu-devel] [PULL 5/5] hw/audio: QOM'ify milkymist-ac97.c Gerd Hoffmann
2016-06-06 12:21 ` [Qemu-devel] [PULL 0/5] audio patch queue Peter Maydell
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=1465196579-26804-3-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zxq_yx_007@163.com \
/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).