From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0piI-00056K-QH for qemu-devel@nongnu.org; Sun, 21 Jul 2013 05:14:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0piH-0005Ik-MT for qemu-devel@nongnu.org; Sun, 21 Jul 2013 05:13:58 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42137 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0piH-0005Ia-GI for qemu-devel@nongnu.org; Sun, 21 Jul 2013 05:13:57 -0400 Message-ID: <51EBA650.7010908@suse.de> Date: Sun, 21 Jul 2013 11:13:52 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 15/26] ahci: use realize for ahci List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: qemu-devel Am 01.07.2013 12:18, schrieb Hu Tao: > Signed-off-by: Hu Tao > --- > hw/ide/ahci.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) >=20 > diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c > index 5dcd662..d92239b 100644 > --- a/hw/ide/ahci.c > +++ b/hw/ide/ahci.c > @@ -1300,14 +1300,13 @@ static void sysbus_ahci_reset(DeviceState *dev) > ahci_reset(&s->ahci); > } > =20 > -static int sysbus_ahci_init(SysBusDevice *dev) > +static void sysbus_ahci_realize(DeviceState *dev, Error **errp) > { > SysbusAHCIState *s =3D SYSBUS_AHCI(dev); > - ahci_init(&s->ahci, DEVICE(dev), NULL, s->num_ports); > + ahci_init(&s->ahci, dev, NULL, s->num_ports); I prepared a local patch to rename ahci_init() to ahci_realize(), but didn't find the time to investigate which parts could safely stay in an ahci_init() called from instance_init, so postponing that. Andreas > =20 > - sysbus_init_mmio(dev, &s->ahci.mem); > - sysbus_init_irq(dev, &s->ahci.irq); > - return 0; > + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->ahci.mem); > + sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->ahci.irq); > } > =20 > static Property sysbus_ahci_properties[] =3D { > @@ -1317,10 +1316,9 @@ static Property sysbus_ahci_properties[] =3D { > =20 > static void sysbus_ahci_class_init(ObjectClass *klass, void *data) > { > - SysBusDeviceClass *sbc =3D SYS_BUS_DEVICE_CLASS(klass); > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > - sbc->init =3D sysbus_ahci_init; > + dc->realize =3D sysbus_ahci_realize; > dc->vmsd =3D &vmstate_sysbus_ahci; > dc->props =3D sysbus_ahci_properties; > dc->reset =3D sysbus_ahci_reset; >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg