From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn2gn-0007EH-PI for qemu-devel@nongnu.org; Wed, 21 May 2014 05:20:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wn2gh-0000ei-Ms for qemu-devel@nongnu.org; Wed, 21 May 2014 05:19:57 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52737 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn2gh-0000eV-H4 for qemu-devel@nongnu.org; Wed, 21 May 2014 05:19:51 -0400 Message-ID: <537C6FB5.8040405@suse.de> Date: Wed, 21 May 2014 11:19:49 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1398353211-31873-1-git-send-email-afaerber@suse.de> In-Reply-To: <1398353211-31873-1-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] pcie_host: Turn pcie_host_init() into an instance_init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, "Michael S. Tsirkin" Cc: Anthony Liguori Am 24.04.2014 17:26, schrieb Andreas F=C3=A4rber: > This assures the trivial field initialization is applied for any derive= d > type - currently only Q35PCIHost. >=20 > Signed-off-by: Andreas F=C3=A4rber > --- > Michael, I've had this preparation lying around for a while but didn't= =20 > get further yet. Can you take this through the PCI queue already? Ping! >=20 > hw/pci-host/q35.c | 4 ---- > hw/pci/pcie_host.c | 7 ++++--- > include/hw/pci/pcie_host.h | 1 - > 3 files changed, 4 insertions(+), 8 deletions(-) >=20 > diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c > index 8b8cc4e..aa48b1c 100644 > --- a/hw/pci-host/q35.c > +++ b/hw/pci-host/q35.c > @@ -47,10 +47,6 @@ static void q35_host_realize(DeviceState *dev, Error= **errp) > sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem); > sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, 4); > =20 > - if (pcie_host_init(PCIE_HOST_BRIDGE(s)) < 0) { > - error_setg(errp, "failed to initialize pcie host"); > - return; > - } > pci->bus =3D pci_bus_new(DEVICE(s), "pcie.0", > s->mch.pci_address_space, s->mch.address_sp= ace_io, > 0, TYPE_PCIE_BUS); > diff --git a/hw/pci/pcie_host.c b/hw/pci/pcie_host.c > index c6e1b57..7c88a1d 100644 > --- a/hw/pci/pcie_host.c > +++ b/hw/pci/pcie_host.c > @@ -83,11 +83,11 @@ static const MemoryRegionOps pcie_mmcfg_ops =3D { > .endianness =3D DEVICE_NATIVE_ENDIAN, > }; > =20 > -int pcie_host_init(PCIExpressHost *e) > +static void pcie_host_init(Object *obj) > { > - e->base_addr =3D PCIE_BASE_ADDR_UNMAPPED; > + PCIExpressHost *e =3D PCIE_HOST_BRIDGE(obj); > =20 > - return 0; > + e->base_addr =3D PCIE_BASE_ADDR_UNMAPPED; > } > =20 > void pcie_host_mmcfg_unmap(PCIExpressHost *e) > @@ -128,6 +128,7 @@ static const TypeInfo pcie_host_type_info =3D { > .parent =3D TYPE_PCI_HOST_BRIDGE, > .abstract =3D true, > .instance_size =3D sizeof(PCIExpressHost), > + .instance_init =3D pcie_host_init, > }; > =20 > static void pcie_host_register_types(void) > diff --git a/include/hw/pci/pcie_host.h b/include/hw/pci/pcie_host.h > index acca45e..ff44ef6 100644 > --- a/include/hw/pci/pcie_host.h > +++ b/include/hw/pci/pcie_host.h > @@ -49,7 +49,6 @@ struct PCIExpressHost { > MemoryRegion mmio; > }; > =20 > -int pcie_host_init(PCIExpressHost *e); > void pcie_host_mmcfg_unmap(PCIExpressHost *e); > void pcie_host_mmcfg_map(PCIExpressHost *e, hwaddr addr, uint32_t size= ); > void pcie_host_mmcfg_update(PCIExpressHost *e, >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg