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: wangyijing X-Patchwork-Id: 40888 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0933E24035 for ; Mon, 17 Nov 2014 09:42:49 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gq15sf536545lab.8 for ; Mon, 17 Nov 2014 01:42:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=Zn/p++yVD0+Mp1Nsfg+S8yi6lYhrCKIu4QP0NQXD6IY=; b=m/K/X/LIWYG6Ma1Ioz0eY1JjN5qsuRE9RAYA9Me5HSdGG66Pj16hUGzRB4YaDtdqI0 awvrAvPwUxgltigv2iBrk2PGOnD9jPsrQPcVRWZSlbfqq238Dm41nFQtKcdQyDpmuutu QUg6fyc/L8moVBlZI7HhiVQqQmTydTptJI9cHfwQMN6OHiA9rysD5kbLT8rV/cK/vWGx c2L8Thw9UCP+vaFmvczIf8Gjf2fdKeXjV/koA859RX9ryeQ9RUuYZZwmXLn2DCh07dC/ Vqaule0JXExujB43bwMzcs0Z9DUzjzXeTIv0Ads+jx1Nn2bwWpiZ5E3EZr8gS8MjAMjj MAdw== X-Gm-Message-State: ALoCoQlZUAnBRi16/phbnFLrmy0jp4smAddaNnh2vczdYuEnjjHfUqI7Q0ajTie5rgmJt4qmp+RO X-Received: by 10.194.134.193 with SMTP id pm1mr4068173wjb.4.1416217367951; Mon, 17 Nov 2014 01:42:47 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.26.200 with SMTP id n8ls1031098lag.10.gmail; Mon, 17 Nov 2014 01:42:47 -0800 (PST) X-Received: by 10.112.50.133 with SMTP id c5mr25937488lbo.54.1416217367659; Mon, 17 Nov 2014 01:42:47 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id w2si51094012lag.73.2014.11.17.01.42.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 01:42:47 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id gq15so2279045lab.34 for ; Mon, 17 Nov 2014 01:42:47 -0800 (PST) X-Received: by 10.153.7.170 with SMTP id dd10mr25889814lad.44.1416217367574; Mon, 17 Nov 2014 01:42:47 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp1127312lbc; Mon, 17 Nov 2014 01:42:46 -0800 (PST) X-Received: by 10.70.94.36 with SMTP id cz4mr433155pdb.169.1416217365847; Mon, 17 Nov 2014 01:42:45 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xo4si13617015pbb.163.2014.11.17.01.42.45 for ; Mon, 17 Nov 2014 01:42:45 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752285AbaKQJmM (ORCPT + 26 others); Mon, 17 Nov 2014 04:42:12 -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-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: wangyijing@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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