From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de ([212.227.17.24]:64518 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753988AbaKSM3Q (ORCPT ); Wed, 19 Nov 2014 07:29:16 -0500 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Yijing Wang , Bjorn Helgaas , Liviu Dudau , Tony Luck , Russell King , linux-pci@vger.kernel.org, x86@kernel.org, Geert Uytterhoeven , linux-ia64@vger.kernel.org, Thomas Gleixner Subject: Re: [PATCH 3/5] PCI: Use pci_scan_bus_simple() in simple scene. Date: Wed, 19 Nov 2014 13:28:50 +0100 Message-ID: <3577231.2krnYe8yCU@wuerfel> In-Reply-To: <1416382369-13587-4-git-send-email-wangyijing@huawei.com> References: <1416382369-13587-1-git-send-email-wangyijing@huawei.com> <1416382369-13587-4-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: linux-pci-owner@vger.kernel.org List-ID: On Wednesday 19 November 2014 15:32:47 Yijing Wang wrote: > Use pci_scan_bus_simple() to scan pci buses with > the default IO/MEM/BUS resources. Use it instead > of pci_scan_bus() and pci_scan_bus_parented(). > > Signed-off-by: Yijing Wang > I think we should replace pci_scan_bus_parented() with something better by making the xen code use pci_scan_root_bus() (see below for a draft patch). After that we no longer need the 'parent' argument here and we can just keep using the pci_scan_bus() function for the legacy users, or rename it if that helps. Arnd 8<--- diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c index 116ca3746adb..45a4843a608a 100644 --- a/drivers/pci/xen-pcifront.c +++ b/drivers/pci/xen-pcifront.c @@ -448,6 +448,7 @@ static int pcifront_scan_root(struct pcifront_device *pdev, struct pci_bus *b; struct pcifront_sd *sd = NULL; struct pci_bus_entry *bus_entry = NULL; + LIST_HEAD(resources); int err = 0; #ifndef CONFIG_PCI_DOMAINS @@ -470,17 +471,20 @@ static int pcifront_scan_root(struct pcifront_device *pdev, err = -ENOMEM; goto err_out; } + pci_add_resource(&resources, &ioport_resource); + pci_add_resource(&resources, &iomem_resource); pcifront_init_sd(sd, domain, bus, pdev); pci_lock_rescan_remove(); - b = pci_scan_bus_parented(&pdev->xdev->dev, bus, - &pcifront_bus_ops, sd); + b = pci_scan_root_bus(&pdev->xdev->dev, bus, &pcifront_bus_ops, sd, + &resources); if (!b) { dev_err(&pdev->xdev->dev, "Error creating PCI Frontend Bus!\n"); err = -ENOMEM; pci_unlock_rescan_remove(); + pci_free_resource_list(&resources); goto err_out; }