From patchwork Mon Nov 17 10:21:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 5316661 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 62A90C11AC for ; Mon, 17 Nov 2014 09:43:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 973102020E for ; Mon, 17 Nov 2014 09:43:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA73D201FA for ; Mon, 17 Nov 2014 09:43:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752247AbaKQJmJ (ORCPT ); Mon, 17 Nov 2014 04:42:09 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:28886 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752092AbaKQJk5 (ORCPT ); Mon, 17 Nov 2014 04:40:57 -0500 Received: from 172.24.2.119 (EHLO szxeml462-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CCM04938; Mon, 17 Nov 2014 17:40:49 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml462-hub.china.huawei.com (10.82.67.205) with Microsoft SMTP Server id 14.3.158.1; Mon, 17 Nov 2014 17:40:39 +0800 From: Yijing Wang To: Bjorn Helgaas CC: , , Xinwei Hu , Wuyun , , Russell King , , Thomas Gleixner , Benjamin Herrenschmidt , , Tony Luck , , Thierry Reding , Liviu Dudau , , Yijing Wang Subject: [RFC PATCH 14/16] arm/PCI: Introduce pci_get_domain_nr() Date: Mon, 17 Nov 2014 18:21:48 +0800 Message-ID: <1416219710-26088-15-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1416219710-26088-1-git-send-email-wangyijing@huawei.com> References: <1416219710-26088-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Signed-off-by: Yijing Wang --- arch/arm/include/asm/mach/pci.h | 9 +++++++++ arch/arm/kernel/bios32.c | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h index f19f627..370b3bd 100644 --- a/arch/arm/include/asm/mach/pci.h +++ b/arch/arm/include/asm/mach/pci.h @@ -90,6 +90,15 @@ extern void pci_map_io_early(unsigned long pfn); static inline void pci_map_io_early(unsigned long pfn) {} #endif +#ifdef CONFIG_PCI_DOMAINS_GENERIC +int pci_get_domain_nr(struct device *parent) +#else +static inline int pci_get_domain_nr(struct device *parent) +{ + return 0; +} +#endif + /* * PCI controllers */ diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index d8c2b4e..3fe56f1 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -513,7 +513,7 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw, #ifdef CONFIG_PCI_DOMAINS_GENERIC static bool dt_domain_found; -void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent) +int pci_get_domain_nr(struct device *parent) { int domain = of_get_pci_domain_nr(parent->of_node); @@ -526,8 +526,12 @@ void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent) } else { domain = pci_get_new_domain_nr(); } + return domain; +} - bus->domain_nr = domain; +void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent) +{ + bus->domain_nr = pci_get_domain_nr(parent); } #endif