From: Yinghai Lu <yinghai@kernel.org>
To: Jesse Barnes <jbarnes@virtuousgeek.org>, x86 <x86@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH 10/12] PCI, pciehp: Separate pci_hp_add_bridge()
Date: Tue, 13 Mar 2012 00:26:32 -0700 [thread overview]
Message-ID: <1331623594-30543-11-git-send-email-yinghai@kernel.org> (raw)
In-Reply-To: <1331623594-30543-1-git-send-email-yinghai@kernel.org>
Will use it for other pci hp hotplug support
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
drivers/pci/hotplug-pci.c | 13 +++++++++++++
drivers/pci/hotplug/pciehp_pci.c | 18 ++----------------
drivers/pci/pci.h | 1 +
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/pci/hotplug-pci.c b/drivers/pci/hotplug-pci.c
index d3509cd..d0999b1 100644
--- a/drivers/pci/hotplug-pci.c
+++ b/drivers/pci/hotplug-pci.c
@@ -4,6 +4,19 @@
#include <linux/export.h>
#include "pci.h"
+int __ref pci_hp_add_bridge(struct pci_dev *dev)
+{
+ struct pci_bus *parent = dev->bus;
+ int pass, busnr = parent->secondary;
+
+ for (pass = 0; pass < 2; pass++)
+ busnr = pci_scan_bridge(parent, dev, busnr, pass);
+ if (!dev->subordinate)
+ return -1;
+
+ return 0;
+}
+EXPORT_SYMBOL(pci_hp_add_bridge);
unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
{
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index e21171c..b9a9fce 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -34,19 +34,6 @@
#include "../pci.h"
#include "pciehp.h"
-static int __ref pciehp_add_bridge(struct pci_dev *dev)
-{
- struct pci_bus *parent = dev->bus;
- int pass, busnr = parent->secondary;
-
- for (pass = 0; pass < 2; pass++)
- busnr = pci_scan_bridge(parent, dev, busnr, pass);
- if (!dev->subordinate)
- return -1;
-
- return 0;
-}
-
int pciehp_configure_device(struct slot *p_slot)
{
struct pci_dev *dev;
@@ -75,9 +62,8 @@ int pciehp_configure_device(struct slot *p_slot)
if (!dev)
continue;
if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) {
- pciehp_add_bridge(dev);
- }
+ (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS))
+ pci_hp_add_bridge(dev);
pci_dev_put(dev);
}
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 13b1159..9378d81 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -124,6 +124,7 @@ static inline int pci_proc_detach_bus(struct pci_bus *bus) { return 0; }
#endif
/* Functions for PCI Hotplug drivers to use */
+int pci_hp_add_bridge(struct pci_dev *dev);
extern unsigned int pci_do_scan_bus(struct pci_bus *bus);
#ifdef HAVE_PCI_LEGACY
--
1.7.7
next prev parent reply other threads:[~2012-03-13 7:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 7:26 [PATCH 00/12] PCI, x86: More pci hotplug related cleanup Yinghai Lu
2012-03-13 7:26 ` [PATCH 01/12] PCI: Add debug print out for pci related dev release Yinghai Lu
2012-03-13 7:26 ` [PATCH 02/12] x86, PCI: Let pcibios_allocate_bus_resources() take bus instead Yinghai Lu
2012-03-13 7:26 ` [PATCH 03/12] PCI: Claim hw/fw allocated resources in hot add path Yinghai Lu
2012-03-13 7:26 ` [PATCH 04/12] PCI: Kill pci_is_reassignedev() Yinghai Lu
2012-03-13 7:26 ` [PATCH 05/12] PCI: Add addon_resource support for pci_dev Yinghai Lu
2012-03-15 21:30 ` Bjorn Helgaas
2012-03-16 3:23 ` Yinghai Lu
2012-03-13 7:26 ` [PATCH 06/12] PCI: Use for_each_pci_dev_resource helper Yinghai Lu
2012-03-13 7:26 ` [PATCH 07/12] PCI: Make piix4 quirk to use addon_resource support Yinghai Lu
2012-03-15 21:36 ` Bjorn Helgaas
2012-03-13 7:26 ` [PATCH 08/12] PCI: Make quirk_io_region " Yinghai Lu
2012-03-13 7:26 ` [PATCH 09/12] PCI: Use addon_fixed_resource with ati fixed resource Yinghai Lu
2012-03-13 7:26 ` Yinghai Lu [this message]
2012-03-15 21:42 ` [PATCH 10/12] PCI, pciehp: Separate pci_hp_add_bridge() Bjorn Helgaas
2012-03-13 7:26 ` [PATCH 11/12] PCI, cphi_hotplug: Simplify configure_slot Yinghai Lu
2012-03-13 7:26 ` [PATCH 12/12] PCI, shpchp: Simplify configure_device Yinghai Lu
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=1331623594-30543-11-git-send-email-yinghai@kernel.org \
--to=yinghai@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bhelgaas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--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).