From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp1040.oracle.com ([156.151.31.81]:31179 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755388Ab3A0TYZ (ORCPT ); Sun, 27 Jan 2013 14:24:25 -0500 From: Yinghai Lu To: Bjorn Helgaas , Jiang Liu , "Rafael J. Wysocki" , Taku Izumi , Toshi Kani Cc: "Greg Kroah-Hartman" , linux-pci@vger.kernel.org, Yinghai Lu , Tony Luck , Fenghua Yu , linux-ia64@vger.kernel.org, linux-altix@sgi.com Subject: [PATCH v3 14/22] PCI, ia64: Kill pci_find_next_bus Date: Sun, 27 Jan 2013 11:23:41 -0800 Message-Id: <1359314629-18651-15-git-send-email-yinghai@kernel.org> In-Reply-To: <1359314629-18651-1-git-send-email-yinghai@kernel.org> References: <1359314629-18651-1-git-send-email-yinghai@kernel.org> Sender: linux-pci-owner@vger.kernel.org List-ID: Replace that with hotplug-safe version iteration. Signed-off-by: Yinghai Lu Cc: Tony Luck Cc: Fenghua Yu Cc: linux-ia64@vger.kernel.org Cc: linux-altix@sgi.com --- arch/ia64/hp/common/sba_iommu.c | 7 ++++--- arch/ia64/sn/kernel/io_common.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index bcda5b2..0f27a37 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c @@ -2155,9 +2155,10 @@ sba_init(void) #ifdef CONFIG_PCI { - struct pci_bus *b = NULL; - while ((b = pci_find_next_bus(b)) != NULL) - sba_connect_bus(b); + struct pci_host_bridge *host_bridge = NULL; + + for_each_pci_host_bridge(host_bridge) + sba_connect_bus(host_bridge->bus); } #endif diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c index 8630875..131938b 100644 --- a/arch/ia64/sn/kernel/io_common.c +++ b/arch/ia64/sn/kernel/io_common.c @@ -516,6 +516,7 @@ arch_initcall(sn_io_early_init); int __init sn_io_late_init(void) { + struct pci_host_bridge *host_bridge = NULL; struct pci_bus *bus; struct pcibus_bussoft *bussoft; cnodeid_t cnode; @@ -530,8 +531,8 @@ sn_io_late_init(void) * PIC, TIOCP, TIOCE (TIOCA does it during bus fixup using * info from the PROM). */ - bus = NULL; - while ((bus = pci_find_next_bus(bus)) != NULL) { + for_each_pci_host_bridge(host_bridge) { + bus = host_bridge->bus; bussoft = SN_PCIBUS_BUSSOFT(bus); nasid = NASID_GET(bussoft->bs_base); cnode = nasid_to_cnodeid(nasid); -- 1.7.10.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yinghai Lu Date: Sun, 27 Jan 2013 19:23:41 +0000 Subject: [PATCH v3 14/22] PCI, ia64: Kill pci_find_next_bus Message-Id: <1359314629-18651-15-git-send-email-yinghai@kernel.org> List-Id: References: <1359314629-18651-1-git-send-email-yinghai@kernel.org> In-Reply-To: <1359314629-18651-1-git-send-email-yinghai@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Bjorn Helgaas , Jiang Liu , "Rafael J. Wysocki" , Taku Izumi , Toshi Kani Cc: Greg Kroah-Hartman , linux-pci@vger.kernel.org, Yinghai Lu , Tony Luck , Fenghua Yu , linux-ia64@vger.kernel.org, linux-altix@sgi.com Replace that with hotplug-safe version iteration. Signed-off-by: Yinghai Lu Cc: Tony Luck Cc: Fenghua Yu Cc: linux-ia64@vger.kernel.org Cc: linux-altix@sgi.com --- arch/ia64/hp/common/sba_iommu.c | 7 ++++--- arch/ia64/sn/kernel/io_common.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index bcda5b2..0f27a37 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c @@ -2155,9 +2155,10 @@ sba_init(void) #ifdef CONFIG_PCI { - struct pci_bus *b = NULL; - while ((b = pci_find_next_bus(b)) != NULL) - sba_connect_bus(b); + struct pci_host_bridge *host_bridge = NULL; + + for_each_pci_host_bridge(host_bridge) + sba_connect_bus(host_bridge->bus); } #endif diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c index 8630875..131938b 100644 --- a/arch/ia64/sn/kernel/io_common.c +++ b/arch/ia64/sn/kernel/io_common.c @@ -516,6 +516,7 @@ arch_initcall(sn_io_early_init); int __init sn_io_late_init(void) { + struct pci_host_bridge *host_bridge = NULL; struct pci_bus *bus; struct pcibus_bussoft *bussoft; cnodeid_t cnode; @@ -530,8 +531,8 @@ sn_io_late_init(void) * PIC, TIOCP, TIOCE (TIOCA does it during bus fixup using * info from the PROM). */ - bus = NULL; - while ((bus = pci_find_next_bus(bus)) != NULL) { + for_each_pci_host_bridge(host_bridge) { + bus = host_bridge->bus; bussoft = SN_PCIBUS_BUSSOFT(bus); nasid = NASID_GET(bussoft->bs_base); cnode = nasid_to_cnodeid(nasid); -- 1.7.10.4