From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:55577 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726901AbeHFOec (ORCPT ); Mon, 6 Aug 2018 10:34:32 -0400 Date: Mon, 6 Aug 2018 14:30:51 +0200 From: Christoph Hellwig To: Lorenzo Pieralisi Cc: Christoph Hellwig , Bjorn Helgaas , Palmer Dabbelt , "Wesley W . Terpstra" , Arnd Bergmann , linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH 1/3] PCI: add a callback to struct pci_host_bridge for adding a new device Message-ID: <20180806123051.GA6997@lst.de> References: <20180804101402.10022-1-hch@lst.de> <20180804101402.10022-2-hch@lst.de> <20180806112310.GB18685@e107981-ln.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20180806112310.GB18685@e107981-ln.cambridge.arm.com> Sender: linux-pci-owner@vger.kernel.org List-ID: On Mon, Aug 06, 2018 at 12:23:10PM +0100, Lorenzo Pieralisi wrote: > > pci_configure_device(dev); > > @@ -2328,6 +2329,11 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus) > > ret = pcibios_add_device(dev); > > WARN_ON(ret < 0); > > > > + if (host->add_device) { > > + ret = host->add_device(dev); > > + WARN_ON(ret < 0); > > + } > > This looks fine; we could go a step further and make the hunk above > the default (weak) implementation of pcibios_add_device() that is > currently a NOP returning 0, I will remove it for v4.20. I'd love to see pcibios_add_device go away entirely. But I wonder how to get setup the pci_host_bridge pointer for the remaining architectures that still implement it. I did look for any easy way but couldn't find one. But then I don't really know this area of the PCI code too well.