From patchwork Mon Jul 20 12:01:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 6826731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 35CE29F358 for ; Mon, 20 Jul 2015 12:09:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3FC9920626 for ; Mon, 20 Jul 2015 12:09:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3942F203E9 for ; Mon, 20 Jul 2015 12:09:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZH9rB-0006zR-WA; Mon, 20 Jul 2015 12:07:42 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZH9qX-0006cq-Oi for linux-arm-kernel@lists.infradead.org; Mon, 20 Jul 2015 12:07:04 +0000 Received: from 172.24.1.49 (EHLO szxeml432-hub.china.huawei.com) ([172.24.1.49]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id COZ21651; Mon, 20 Jul 2015 20:05:30 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml432-hub.china.huawei.com (10.82.67.209) with Microsoft SMTP Server id 14.3.158.1; Mon, 20 Jul 2015 20:05:20 +0800 From: Yijing Wang To: Bjorn Helgaas Subject: [PATCH part3 v12 05/10] powerpc/PCI: Rename pcibios_root_bridge_prepare() to pcibios_root_bus_prepare() Date: Mon, 20 Jul 2015 20:01:13 +0800 Message-ID: <1437393678-4077-6-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1437393678-4077-1-git-send-email-wangyijing@huawei.com> References: <1437393678-4077-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150720_050702_347695_4D6D0C44 X-CRM114-Status: GOOD ( 16.99 ) X-Spam-Score: -5.4 (-----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, linux-pci@vger.kernel.org, Yijing Wang , Guan Xuetao , linux-s390@vger.kernel.org, linux-am33-list@redhat.com, Russell King , x86@kernel.org, Geert Uytterhoeven , Benjamin Herrenschmidt , linux-xtensa@linux-xtensa.org, Arnd Bergmann , Rusty Russell , linux-m68k@lists.linux-m68k.org, Thomas Gleixner , linux-arm-kernel@lists.infradead.org, dja@axtens.net, Tony Luck , linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Pcibios_root_bridge_prepare() in powerpc set root bus speed, it's not the preparation for pci host bridge. For better separation of host bridge and root bus creation, It's need to rename it to another weak function. Signed-off-by: Yijing Wang --- arch/powerpc/include/asm/machdep.h | 2 +- arch/powerpc/kernel/pci-common.c | 6 +++--- arch/powerpc/platforms/pseries/pci.c | 2 +- arch/powerpc/platforms/pseries/pseries.h | 2 +- arch/powerpc/platforms/pseries/setup.c | 2 +- drivers/pci/probe.c | 9 +++++++++ 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 952579f..dbd5e8b 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h @@ -100,7 +100,7 @@ struct machdep_calls { /* Called after allocating resources */ void (*pcibios_fixup)(void); void (*pci_irq_fixup)(struct pci_dev *dev); - int (*pcibios_root_bridge_prepare)(struct pci_host_bridge + int (*pcibios_root_bus_prepare)(struct pci_host_bridge *bridge); /* To setup PHBs when using automatic OF platform driver for PCI */ diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index df7f018..3e398c8 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -782,10 +782,10 @@ int pci_proc_domain(struct pci_bus *bus) return 1; } -int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) +int pcibios_root_bus_prepare(struct pci_host_bridge *bridge) { - if (ppc_md.pcibios_root_bridge_prepare) - return ppc_md.pcibios_root_bridge_prepare(bridge); + if (ppc_md.pcibios_root_bus_prepare) + return ppc_md.pcibios_root_bus_prepare(bridge); return 0; } diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index fe16a50..885f9ff 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c @@ -110,7 +110,7 @@ static void fixup_winbond_82c105(struct pci_dev* dev) DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, fixup_winbond_82c105); -int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) +int pseries_root_bus_prepare(struct pci_host_bridge *bridge) { struct device_node *dn, *pdn; struct pci_bus *bus; diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h index 8411c27..41310dc 100644 --- a/arch/powerpc/platforms/pseries/pseries.h +++ b/arch/powerpc/platforms/pseries/pseries.h @@ -75,7 +75,7 @@ static inline int dlpar_memory(struct pseries_hp_errorlog *hp_elog) /* PCI root bridge prepare function override for pseries */ struct pci_host_bridge; -int pseries_root_bridge_prepare(struct pci_host_bridge *bridge); +int pseries_root_bus_prepare(struct pci_host_bridge *bridge); extern struct pci_controller_ops pseries_pci_controller_ops; diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index df6a704..2815309 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -537,7 +537,7 @@ static void __init pSeries_setup_arch(void) ppc_md.enable_pmcs = power4_enable_pmcs; } - ppc_md.pcibios_root_bridge_prepare = pseries_root_bridge_prepare; + ppc_md.pcibios_root_bus_prepare = pseries_root_bus_prepare; if (firmware_has_feature(FW_FEATURE_SET_MODE)) { long rc; diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index b49deb8..0eba126 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1919,6 +1919,11 @@ int __weak pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) return 0; } +int __weak pcibios_root_bus_prepare(struct pci_host_bridge *bridge) +{ + return 0; +} + void __weak pcibios_add_bus(struct pci_bus *bus) { } @@ -1984,6 +1989,10 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int domain, b->dev.class = &pcibus_class; b->dev.parent = b->bridge; dev_set_name(&b->dev, "%04x:%02x", pci_domain_nr(b), bus); + error = pcibios_root_bus_prepare(bridge); + if (error) + goto class_dev_reg_err; + error = device_register(&b->dev); if (error) goto class_dev_reg_err;