From mboxrd@z Thu Jan 1 00:00:00 1970 From: Liviu Dudau Subject: Re: [PATCH v7 6/6] pci: Add support for creating a generic host_bridge from device tree Date: Tue, 8 Apr 2014 14:09:20 +0100 Message-ID: <20140408130920.GY17163@e106497-lin.cambridge.arm.com> References: <1394811272-1547-1-git-send-email-Liviu.Dudau@arm.com> <1394811272-1547-7-git-send-email-Liviu.Dudau@arm.com> <5343F252.2050708@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <5343F252.2050708@linaro.org> Content-Disposition: inline Sender: linux-pci-owner@vger.kernel.org To: Hanjun Guo Cc: linux-pci , Bjorn Helgaas , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , linaro-kernel , Arnd Bergmann , Grant Likely , "devicetree@vger.kernel.org" , LKML , LAKML , Tanmay Inamdar List-Id: devicetree@vger.kernel.org Hi Hanjun, On Tue, Apr 08, 2014 at 01:57:54PM +0100, Hanjun Guo wrote: > Hi Liviu, >=20 > On 2014-3-14 23:34, Liviu Dudau wrote: > > Several platforms use a rather generic version of parsing > > the device tree to find the host bridge ranges. Move the common cod= e > > into the generic PCI code and use it to create a pci_host_bridge > > structure that can be used by arch code. > >=20 > > Based on early attempts by Andrew Murray to unify the code. > > Used powerpc and microblaze PCI code as starting point. > >=20 > > Signed-off-by: Liviu Dudau > > Tested-by: Tanmay Inamdar > > --- > > drivers/pci/host-bridge.c | 158 ++++++++++++++++++++++++++++++++++= ++ > > include/linux/pci.h | 13 +++ > > 2 files changed, 171 insertions(+) > >=20 > > diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c > > index 8708b652..7cda90b 100644 > > --- a/drivers/pci/host-bridge.c > > +++ b/drivers/pci/host-bridge.c > > @@ -6,9 +6,14 @@ > > #include > > #include > > #include > > +#include > > +#include > > +#include > > =20 > > #include "pci.h" > > =20 > > +static atomic_t domain_nr =3D ATOMIC_INIT(-1); >=20 > domain_nr will only be used inside the #ifdef CONFIG_OF, > and this will lead to compile warning which complains that > 'domain_nr' defined but not used when CONFIG_OF=3Dn (for example > on x86). >=20 > How about moving the definition to ---> >=20 > > + > > static struct pci_bus *find_pci_root_bus(struct pci_bus *bus) > > { > > while (bus->parent) > > @@ -92,3 +97,156 @@ void pcibios_bus_to_resource(struct pci_bus *bu= s, struct resource *res, > > res->end =3D region->end + offset; > > } > > EXPORT_SYMBOL(pcibios_bus_to_resource); > > + > > +#ifdef CONFIG_OF >=20 > here? I've already moved the definition there in my refresh. Thanks for reviewing the code, Liviu >=20 > Thanks > Hanjun >=20 --=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- =C2=AF\_(=E3=83=84)_/=C2=AF