linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yijing Wang <wangyijing@huawei.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: <linux-pci@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Russell King <linux@arm.linux.org.uk>, <x86@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Tony Luck <tony.luck@intel.com>, <linux-ia64@vger.kernel.org>,
	Liviu Dudau <liviu@dudau.co.uk>, Arnd Bergmann <arnd@arndb.de>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Yijing Wang <wangyijing@huawei.com>
Subject: [PATCH 2/5] PCI: Introduce pci_scan_bus_simple()
Date: Wed, 19 Nov 2014 15:32:46 +0800	[thread overview]
Message-ID: <1416382369-13587-3-git-send-email-wangyijing@huawei.com> (raw)
In-Reply-To: <1416382369-13587-1-git-send-email-wangyijing@huawei.com>

Now pci_scan_bus() and pci_scan_bus_parented()
are almost the same except parent device.
There is no need to use two similar scan interfaces.
Introduce pci_scan_bus_simple() which is same
as pci_scan_bus_parented(). And remove pci_scan_bus()
and pci_scan_bus_parented() in later patch.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pci/probe.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 5c5e01e..a8d90d4 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2089,6 +2089,24 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,
 }
 EXPORT_SYMBOL(pci_scan_root_bus);
 
+struct pci_bus *pci_scan_bus_simple(struct device *parent,
+		int bus, struct pci_ops *ops, void *sysdata)
+{
+	LIST_HEAD(resources);
+	struct pci_bus *b;
+
+	pci_add_resource(&resources, &ioport_resource);
+	pci_add_resource(&resources, &iomem_resource);
+	pci_add_resource(&resources, &busn_resource);
+	b = pci_create_root_bus(parent, bus, ops, sysdata, &resources);
+	if (b)
+		pci_scan_child_bus(b);
+	else
+		pci_free_resource_list(&resources);
+	return b;
+}
+EXPORT_SYMBOL(pci_scan_bus_simple);
+
 /* Deprecated; use pci_scan_root_bus() instead */
 struct pci_bus *pci_scan_bus_parented(struct device *parent,
 		int bus, struct pci_ops *ops, void *sysdata)
-- 
1.7.1


  parent reply	other threads:[~2014-11-19  6:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19  7:32 [PATCH 0/5] PCI scan interfaces clean up Yijing Wang
2014-11-19  7:32 ` [PATCH 1/5] PCI: Rip out pci_bus_add_devices() from pci_scan_bus() Yijing Wang
2014-11-19  7:32 ` Yijing Wang [this message]
2014-11-19  7:32 ` [PATCH 3/5] PCI: Use pci_scan_bus_simple() in simple scene Yijing Wang
2014-11-19 12:28   ` Arnd Bergmann
2014-11-20  1:53     ` Yijing Wang
2014-11-19  7:32 ` [PATCH 4/5] PCI: Remove pci_scan_bus() and pci_scan_bus_parented() Yijing Wang
2014-11-19  7:32 ` [PATCH 5/5] PCI: Rip out pci_bus_add_devices() from pci_scan_root_bus() Yijing Wang
2014-11-19 11:49   ` Lorenzo Pieralisi
2014-11-20  1:14     ` Yijing Wang
2014-11-19 12:11   ` Arnd Bergmann
2014-11-19 19:03     ` Liviu Dudau
2014-11-20  1:49     ` Yijing Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416382369-13587-3-git-send-email-wangyijing@huawei.com \
    --to=wangyijing@huawei.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=liviu@dudau.co.uk \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).