[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1369583597-3801-8-git-send-email-jiang.liu@huawei.com>
Date: Sun, 26 May 2013 23:53:04 +0800
From: Jiang Liu <liuj97@...il.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>,
Yinghai Lu <yinghai@...nel.org>
Cc: Jiang Liu <jiang.liu@...wei.com>,
"Rafael J . Wysocki" <rjw@...k.pl>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Gu Zheng <guz.fnst@...fujitsu.com>,
Toshi Kani <toshi.kani@...com>,
Myron Stowe <myron.stowe@...hat.com>,
Yijing Wang <wangyijing@...wei.com>,
Jiang Liu <liuj97@...il.com>, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, Tony Luck <tony.luck@...el.com>,
Fenghua Yu <fenghua.yu@...el.com>, linux-ia64@...r.kernel.org
Subject: [PATCH v3, part2 07/20] PCI, IA64: use hotplug-safe iterators to walk PCI buses
Enhance IA64 architecture specific code to use hotplug-safe iterators
to walk PCI buses.
Signed-off-by: Jiang Liu <jiang.liu@...wei.com>
Cc: Tony Luck <tony.luck@...el.com>
Cc: Fenghua Yu <fenghua.yu@...el.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-ia64@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
arch/ia64/hp/common/sba_iommu.c | 2 +-
arch/ia64/sn/kernel/io_common.c | 2 +-
arch/ia64/sn/pci/tioca_provider.c | 3 ++-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index bcda5b2..6faf241 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -2156,7 +2156,7 @@ sba_init(void)
#ifdef CONFIG_PCI
{
struct pci_bus *b = NULL;
- while ((b = pci_find_next_bus(b)) != NULL)
+ for_each_pci_root_bus(b)
sba_connect_bus(b);
}
#endif
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
index 11f2275..87d8d8f 100644
--- a/arch/ia64/sn/kernel/io_common.c
+++ b/arch/ia64/sn/kernel/io_common.c
@@ -530,7 +530,7 @@ sn_io_late_init(void)
* info from the PROM).
*/
bus = NULL;
- while ((bus = pci_find_next_bus(bus)) != NULL) {
+ for_each_pci_root_bus(bus) {
bussoft = SN_PCIBUS_BUSSOFT(bus);
nasid = NASID_GET(bussoft->bs_base);
cnode = nasid_to_cnodeid(nasid);
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index a70b11f..cd8c0fb 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -624,7 +624,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
nasid_to_cnodeid(tioca_common->ca_closest_nasid);
tioca_common->ca_kernel_private = (u64) tioca_kern;
- bus = pci_find_bus(tioca_common->ca_common.bs_persist_segment,
+ bus = pci_get_bus(tioca_common->ca_common.bs_persist_segment,
tioca_common->ca_common.bs_persist_busnum);
BUG_ON(!bus);
tioca_kern->ca_devices = &bus->devices;
@@ -632,6 +632,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
/* init GART */
if (tioca_gart_init(tioca_kern) < 0) {
+ pci_bus_put(bus);
kfree(tioca_kern);
kfree(tioca_common);
return NULL;
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists