From patchwork Tue May 14 16:51:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2568061 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 3E5E7E00E5 for ; Tue, 14 May 2013 16:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757841Ab3ENQwt (ORCPT ); Tue, 14 May 2013 12:52:49 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:52743 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757811Ab3ENQws (ORCPT ); Tue, 14 May 2013 12:52:48 -0400 Received: by mail-pa0-f44.google.com with SMTP id jh10so695198pab.3 for ; Tue, 14 May 2013 09:52:47 -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=Le5py2Ftm/xc31glpoDNE5Q9p+1vaO97D8Y3fVe2pZM=; b=wGLeQ348vt6uEpFDnh6fqMjBotF7zc8f8vdivw+5vu5bj+SF4zxM5hQvqtbDe20X1O gaT3MKXfEz+17y39uwuEF4+y2D/UBG2CNtMnXQWgSASV40KVPFzG0Jt5NIcDvZDBoWKw FPtX2FxX5Q56zMYRJ2+4sZ0/jfzFE6JwdOEHM6E5WX3uu3d5azLD9gFoU/FYFsdEJtYc bj+VbeS67SJppHVX55XbNiD65hoJE9m6PmeVnXUpfikhyx7/kVdh4WQqHdeimQ7H4EEV /qg514tMnb4Il3XuM9d3A0HSI4pg8czZ3gXmVnNUlxCgdRQZsp6LvVLqAoWUw+ayNbGe g00Q== X-Received: by 10.68.134.6 with SMTP id pg6mr34750073pbb.39.1368550367802; Tue, 14 May 2013 09:52:47 -0700 (PDT) Received: from localhost.localdomain ([120.196.98.100]) by mx.google.com with ESMTPSA id v5sm18919924pbz.4.2013.05.14.09.52.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 May 2013 09:52:47 -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 Howells , Sebastian Andrzej Siewior Subject: [RFC PATCH v2, part 2 05/18] PCI, FRV: use hotplug-safe iterators to walk PCI buses Date: Wed, 15 May 2013 00:51:49 +0800 Message-Id: <1368550322-1045-5-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 FRV architecture specific code to use hotplug-safe iterators to walk PCI buses. Signed-off-by: Jiang Liu Cc: David Howells Cc: Jiang Liu Cc: Bjorn Helgaas Cc: Greg Kroah-Hartman Cc: Sebastian Andrzej Siewior Cc: Yinghai Lu Cc: linux-kernel@vger.kernel.org --- arch/frv/mb93090-mb00/pci-frv.c | 5 ++++- arch/frv/mb93090-mb00/pci-vdk.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c index c281217..48ee89a 100644 --- a/arch/frv/mb93090-mb00/pci-frv.c +++ b/arch/frv/mb93090-mb00/pci-frv.c @@ -188,8 +188,11 @@ static void __init pcibios_assign_resources(void) void __init pcibios_resource_survey(void) { + struct pci_bus *bus; + DBG("PCI: Allocating resources\n"); - pcibios_allocate_bus_resources(&pci_root_buses); + for_each_pci_root_bus(bus) + pcibios_allocate_bus_resources(&bus->children); pcibios_allocate_resources(0); pcibios_allocate_resources(1); pcibios_assign_resources(); diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c index 0aa35f0..f1d6c16 100644 --- a/arch/frv/mb93090-mb00/pci-vdk.c +++ b/arch/frv/mb93090-mb00/pci-vdk.c @@ -234,7 +234,7 @@ static void __init pcibios_fixup_peer_bridges(void) return; printk("PCI: Peer bridge fixup\n"); for (n=0; n <= pcibios_last_bus; n++) { - if (pci_find_bus(0, n)) + if (pci_bus_exists(0, n)) continue; bus.number = n; bus.ops = pci_root_ops;