From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 6/8] timer: cadence_ttc: Convert to instance_init
Date: Mon, 30 Jun 2014 13:47:29 +0100 [thread overview]
Message-ID: <1404132451-32498-7-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1404132451-32498-1-git-send-email-peter.maydell@linaro.org>
From: Alistair Francis <alistair.francis@xilinx.com>
SysBusDevice::init is deprecated. Convert to instance_init
as prescribed by QOM conventions.
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 1223f14833159b9ea5c57734dd2ffa88d4b15a83.1403583596.git.alistair.francis@xilinx.com
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/timer/cadence_ttc.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/hw/timer/cadence_ttc.c b/hw/timer/cadence_ttc.c
index 52bbbbc..d46db3c 100644
--- a/hw/timer/cadence_ttc.c
+++ b/hw/timer/cadence_ttc.c
@@ -406,21 +406,19 @@ static void cadence_timer_init(uint32_t freq, CadenceTimerState *s)
s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, cadence_timer_tick, s);
}
-static int cadence_ttc_init(SysBusDevice *dev)
+static void cadence_ttc_init(Object *obj)
{
- CadenceTTCState *s = CADENCE_TTC(dev);
+ CadenceTTCState *s = CADENCE_TTC(obj);
int i;
for (i = 0; i < 3; ++i) {
cadence_timer_init(133000000, &s->timer[i]);
- sysbus_init_irq(dev, &s->timer[i].irq);
+ sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->timer[i].irq);
}
- memory_region_init_io(&s->iomem, OBJECT(s), &cadence_ttc_ops, s,
+ memory_region_init_io(&s->iomem, obj, &cadence_ttc_ops, s,
"timer", 0x1000);
- sysbus_init_mmio(dev, &s->iomem);
-
- return 0;
+ sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->iomem);
}
static void cadence_timer_pre_save(void *opaque)
@@ -474,9 +472,7 @@ static const VMStateDescription vmstate_cadence_ttc = {
static void cadence_ttc_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
- SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
- sdc->init = cadence_ttc_init;
dc->vmsd = &vmstate_cadence_ttc;
}
@@ -484,6 +480,7 @@ static const TypeInfo cadence_ttc_info = {
.name = TYPE_CADENCE_TTC,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(CadenceTTCState),
+ .instance_init = cadence_ttc_init,
.class_init = cadence_ttc_class_init,
};
--
1.9.1
next prev parent reply other threads:[~2014-06-30 12:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-30 12:47 [Qemu-devel] [PULL 0/8] target-arm queue Peter Maydell
2014-06-30 12:47 ` [Qemu-devel] [PULL 1/8] hw/arm/virt: Provide PL031 RTC Peter Maydell
2014-06-30 12:47 ` [Qemu-devel] [PULL 2/8] hw/arm/strongarm: Fix handling of GPSR/GPCR reads Peter Maydell
2014-06-30 12:47 ` [Qemu-devel] [PULL 3/8] hw/arm/strongarm: Wire up missing GPIO and PPC vmstate Peter Maydell
2014-06-30 12:47 ` [Qemu-devel] [PULL 4/8] hw/arm/pxa2xx_gpio: Fix handling of GPSR/GPCR reads Peter Maydell
2014-06-30 12:47 ` [Qemu-devel] [PULL 5/8] hw/arm/pxa2xx_gpio: Correct and register vmstate Peter Maydell
2014-06-30 12:47 ` Peter Maydell [this message]
2014-06-30 12:47 ` [Qemu-devel] [PULL 7/8] disas/libvixl: Update README for version base Peter Maydell
2014-06-30 12:47 ` [Qemu-devel] [PULL 8/8] disas/libvixl: Fix wrong format strings Peter Maydell
2014-06-30 14:42 ` [Qemu-devel] [PULL 0/8] target-arm 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=1404132451-32498-7-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--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).