From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uvqnd-0007qd-Bf for qemu-devel@nongnu.org; Sun, 07 Jul 2013 11:22:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uvqnc-0002Dm-A4 for qemu-devel@nongnu.org; Sun, 07 Jul 2013 11:22:53 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53635 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uvqnb-0002Di-Vx for qemu-devel@nongnu.org; Sun, 07 Jul 2013 11:22:52 -0400 Message-ID: <51D987C4.9090508@suse.de> Date: Sun, 07 Jul 2013 17:22:44 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <5eb14dae7f16c5ff92b414605acb134bbc5269bc.1372673778.git.hutao@cn.fujitsu.com> In-Reply-To: <5eb14dae7f16c5ff92b414605acb134bbc5269bc.1372673778.git.hutao@cn.fujitsu.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 03/26] ohci: use realize for ohci List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: Peter Crosthwaite , qemu-devel Am 01.07.2013 12:18, schrieb Hu Tao: > Signed-off-by: Hu Tao > --- > hw/usb/hcd-ohci.c | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) >=20 > diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c > index 912255d..ee824ee 100644 > --- a/hw/usb/hcd-ohci.c > +++ b/hw/usb/hcd-ohci.c > @@ -1880,17 +1880,16 @@ typedef struct { > dma_addr_t dma_offset; > } OHCISysBusState; > =20 > -static int ohci_init_pxa(SysBusDevice *dev) > +static void ohci_realize_pxa(DeviceState *dev, Error **errp) > { > OHCISysBusState *s =3D SYSBUS_OHCI(dev); > + SysBusDevice *b =3D SYS_BUS_DEVICE(dev); I stumbled over b not being very descriptive for SysBusDevice (I would've expected d for ...Device). Seeing that PCIDevice *pd was used elsewhere, I will adopt sbd here, as suggested by Peter C. https://github.com/afaerber/qemu-cpu/commits/qom-next Regards, Andreas > =20 > /* Cannot fail as we pass NULL for masterbus */ > - usb_ohci_init(&s->ohci, DEVICE(dev), s->num_ports, s->dma_offset, = NULL, 0, > + usb_ohci_init(&s->ohci, dev, s->num_ports, s->dma_offset, NULL, 0, > &address_space_memory); > - sysbus_init_irq(dev, &s->ohci.irq); > - sysbus_init_mmio(dev, &s->ohci.mem); > - > - return 0; > + sysbus_init_irq(b, &s->ohci.irq); > + sysbus_init_mmio(b, &s->ohci.mem); > } > =20 > static Property ohci_pci_properties[] =3D { > @@ -1930,9 +1929,8 @@ static Property ohci_sysbus_properties[] =3D { > static void ohci_sysbus_class_init(ObjectClass *klass, void *data) > { > DeviceClass *dc =3D DEVICE_CLASS(klass); > - SysBusDeviceClass *sbc =3D SYS_BUS_DEVICE_CLASS(klass); > =20 > - sbc->init =3D ohci_init_pxa; > + dc->realize =3D ohci_realize_pxa; > dc->desc =3D "OHCI USB Controller"; > dc->props =3D ohci_sysbus_properties; > } >=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