From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn2ow-0006iU-Hk for qemu-devel@nongnu.org; Wed, 21 May 2014 05:28:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wn2or-0000hA-EE for qemu-devel@nongnu.org; Wed, 21 May 2014 05:28:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52044) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn2or-0000gx-4t for qemu-devel@nongnu.org; Wed, 21 May 2014 05:28:17 -0400 Date: Wed, 21 May 2014 12:27:10 +0300 From: "Michael S. Tsirkin" Message-ID: <20140521092710.GB19646@redhat.com> References: <1398353211-31873-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1398353211-31873-1-git-send-email-afaerber@suse.de> 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: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: qemu-devel@nongnu.org, Anthony Liguori On Thu, Apr 24, 2014 at 05:26:51PM +0200, Andreas F=E4rber wrote: > This assures the trivial field initialization is applied for any derive= d > type - currently only Q35PCIHost. >=20 > Signed-off-by: Andreas F=E4rber > --- > 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? Applied, sorry about the delay. >=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 > 1.8.4.5