From patchwork Tue May 14 16:51:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2568011 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 58B07DF24C for ; Tue, 14 May 2013 16:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757786Ab3ENQxR (ORCPT ); Tue, 14 May 2013 12:53:17 -0400 Received: from mail-pb0-f49.google.com ([209.85.160.49]:59474 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757681Ab3ENQxP (ORCPT ); Tue, 14 May 2013 12:53:15 -0400 Received: by mail-pb0-f49.google.com with SMTP id rp2so583106pbb.8 for ; Tue, 14 May 2013 09:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=oUK2kC1gDGawvUIwwlfRRxgylk5wfYAnhvCN2j9WU+w=; b=nJZtPatFE9V0s2aKbB87CvSp6ZtlTyfqej41vNvTV9cuXfHJK+RfOe0Q1DhdemZIAr rpqxdP0DjwLWNtNFLrd3Lhkzt/Wx6WqyhN2uNpLH2TxUtw5KzObIW+J6cxTW9aOkl6mI M5f4lWFsbCO2GmErbra4apShUuCiB8UakzMQQIgGKiclV4XSahZgN/jBD3p9qu+E//t2 p4bpGTJUFhSpjPJCo6C1zZ6C8kMoHN5uF+hcRJC19FMXlOVCOmkomd6smgOlnxfaR211 Zf4+Vt3oEWdrk6g89Jdwv7k6MmvSv2QG/OUsT53GtawdMJ2LizpRVoyKp9JfxbH2eX18 R1ag== X-Received: by 10.66.11.164 with SMTP id r4mr21121779pab.221.1368550394498; Tue, 14 May 2013 09:53:14 -0700 (PDT) Received: from localhost.localdomain ([120.196.98.100]) by mx.google.com with ESMTPSA id v5sm18919924pbz.4.2013.05.14.09.53.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 May 2013 09:53:13 -0700 (PDT) From: Jiang Liu To: Bjorn Helgaas , Yinghai Lu Cc: Jiang Liu , "Rafael J . Wysocki" , Greg Kroah-Hartman , Gu Zheng , Toshi Kani , Myron Stowe , Yijing Wang , Jiang Liu , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , Andrew Morton , sparclinux@vger.kernel.org Subject: [RFC PATCH v2, part 2 10/18] PCI, SPARC: use hotplug-safe iterators to walk PCI buses Date: Wed, 15 May 2013 00:51:54 +0800 Message-Id: <1368550322-1045-10-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1368550322-1045-1-git-send-email-jiang.liu@huawei.com> References: <1368550322-1045-1-git-send-email-jiang.liu@huawei.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Enhance SPARC architecture specific code to use hotplug-safe iterators to walk PCI buses. Signed-off-by: Jiang Liu Cc: "David S. Miller" Cc: Bjorn Helgaas Cc: Jiang Liu Cc: Yinghai Lu Cc: Andrew Morton Cc: sparclinux@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- arch/sparc/kernel/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index e5871fb..235208d8 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c @@ -995,9 +995,9 @@ static void pci_bus_slot_names(struct device_node *node, struct pci_bus *bus) static int __init of_pci_slot_init(void) { - struct pci_bus *pbus = NULL; + struct pci_bus *pbus; - while ((pbus = pci_find_next_bus(pbus)) != NULL) { + for_each_pci_root_bus(pbus) { struct device_node *node; if (pbus->self) {