From: Yinghai Lu <yinghai@kernel.org>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org, Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH 4/7] PCI, cpqhp: Using pci_hp_add_bridge
Date: Mon, 7 May 2012 13:29:13 -0700 [thread overview]
Message-ID: <1336422556-4124-5-git-send-email-yinghai@kernel.org> (raw)
In-Reply-To: <1336422556-4124-1-git-send-email-yinghai@kernel.org>
instead of open code with pci_add_new_bus()/do_scan_bus...
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
drivers/pci/hotplug/cpqphp_pci.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
index 1c84940..09801c6 100644
--- a/drivers/pci/hotplug/cpqphp_pci.c
+++ b/drivers/pci/hotplug/cpqphp_pci.c
@@ -83,7 +83,6 @@ static void __iomem *detect_HRT_floating_pointer(void __iomem *begin, void __iom
int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func)
{
- unsigned char bus;
struct pci_bus *child;
int num;
@@ -106,9 +105,10 @@ int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func)
}
if (func->pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
- pci_read_config_byte(func->pci_dev, PCI_SECONDARY_BUS, &bus);
- child = (struct pci_bus*) pci_add_new_bus(func->pci_dev->bus, (func->pci_dev), bus);
- pci_do_scan_bus(child);
+ pci_hp_add_bridge(func->pci_dev);
+ child = func->pci_dev->subordinate;
+ if (child)
+ pci_bus_add_devices(child);
}
pci_dev_put(func->pci_dev);
--
1.7.7
next prev parent reply other threads:[~2012-05-07 20:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-07 20:29 [PATCH 0/7] PCI: hotplug bridge replated clean up Yinghai Lu
2012-05-07 20:29 ` [PATCH 1/7] PCI, pciehp: Separate pci_hp_add_bridge() Yinghai Lu
2012-05-07 20:29 ` [PATCH 2/7] PCI, cpci_hotplug: Simplify configure_slot Yinghai Lu
2012-05-07 20:29 ` [PATCH 3/7] PCI, shpchp: Simplify configure_device Yinghai Lu
2012-05-07 20:29 ` Yinghai Lu [this message]
2012-05-07 20:29 ` [PATCH 5/7] PCI, ibmhp: Using pci_hp_add_bridge Yinghai Lu
2012-05-07 20:29 ` [PATCH 6/7] PCI, sgihp: " Yinghai Lu
2012-05-07 20:29 ` [PATCH 7/7] PCI, hotplug: remove pci_do_scan_bus() 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=1336422556-4124-5-git-send-email-yinghai@kernel.org \
--to=yinghai@kernel.org \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.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).