From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtOkP-0001Q0-LV for qemu-devel@nongnu.org; Sun, 30 Jun 2013 17:01:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtOkO-0003mL-8A for qemu-devel@nongnu.org; Sun, 30 Jun 2013 17:01:25 -0400 Received: from cantor2.suse.de ([195.135.220.15]:58311 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtOkN-0003mC-Rc for qemu-devel@nongnu.org; Sun, 30 Jun 2013 17:01:24 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 30 Jun 2013 23:01:04 +0200 Message-Id: <1372626065-6043-15-git-send-email-afaerber@suse.de> In-Reply-To: <1372626065-6043-1-git-send-email-afaerber@suse.de> References: <1372626065-6043-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH RFC 14/15] cpu/a15mpcore: Convert to QOM realize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Paul Brook From: Andreas F=C3=A4rber Turn SysBusDevice initfn into a QOM realizefn. Signed-off-by: Andreas F=C3=A4rber --- hw/cpu/a15mpcore.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c index ee09b57..7fd120f 100644 --- a/hw/cpu/a15mpcore.c +++ b/hw/cpu/a15mpcore.c @@ -67,8 +67,9 @@ static void a15mp_priv_initfn(Object *obj) qdev_prop_set_uint32(gicdev, "revision", 2); } =20 -static int a15mp_priv_init(SysBusDevice *dev) +static void a15mp_priv_realize(DeviceState *dev, Error **errp) { + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); A15MPPrivState *s =3D A15MPCORE_PRIV(dev); DeviceState *gicdev; SysBusDevice *busdev; @@ -80,10 +81,10 @@ static int a15mp_priv_init(SysBusDevice *dev) busdev =3D SYS_BUS_DEVICE(&s->gic); =20 /* Pass through outbound IRQ lines from the GIC */ - sysbus_pass_irq(dev, busdev); + sysbus_pass_irq(sbd, busdev); =20 /* Pass through inbound GPIO lines to the GIC */ - qdev_init_gpio_in(DEVICE(dev), a15mp_priv_set_irq, s->num_irq - 32); + qdev_init_gpio_in(dev, a15mp_priv_set_irq, s->num_irq - 32); =20 /* Memory map (addresses are offsets from PERIPHBASE): * 0x0000-0x0fff -- reserved @@ -97,8 +98,6 @@ static int a15mp_priv_init(SysBusDevice *dev) sysbus_mmio_get_region(busdev, 0)); memory_region_add_subregion(&s->container, 0x2000, sysbus_mmio_get_region(busdev, 1)); - - return 0; } =20 static Property a15mp_priv_properties[] =3D { @@ -116,8 +115,8 @@ static Property a15mp_priv_properties[] =3D { static void a15mp_priv_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); - k->init =3D a15mp_priv_init; + + dc->realize =3D a15mp_priv_realize; dc->props =3D a15mp_priv_properties; /* We currently have no savable state */ } --=20 1.8.1.4