From patchwork Fri Jun 10 19:55:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 9170387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8D6306048F for ; Fri, 10 Jun 2016 19:58:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D6D626E5D for ; Fri, 10 Jun 2016 19:58:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F39528325; Fri, 10 Jun 2016 19:58:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 4FF2C282F9 for ; Fri, 10 Jun 2016 19:58:28 +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 1bBSY1-0001WU-6h; Fri, 10 Jun 2016 19:56:53 +0000 Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bBSXR-00012i-2U for linux-arm-kernel@lists.infradead.org; Fri, 10 Jun 2016 19:56:18 +0000 Received: by mail-lf0-x236.google.com with SMTP id j7so28542559lfg.1 for ; Fri, 10 Jun 2016 12:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RvL9sQu/aNpw8DUH0zWuQcRzFQAn/CN9Av59oXuUPVY=; b=vG873rEuN5/mSJxb99Y4dbVbx95JAvJtAqnpQWEYcI27a+FWO4QkiKCENQtsmwK1Mm b4dDqPVtLStAiazXn+gQTkUi3hcprDBnMvQprmAE7J2oRhr1TaS/TlIt3Fe3FNtBOomR r6XtQ7rr1/oA2cMAKPMAmhvI9D2HVX0FNAgDO55leeJXAbZo27Hwsi3vXTqPNPge2jnx 29qldYKnX42mKK6E6Twvb8dvuNOp9ktzGtRoO3N/EskgFsRR74bb2F+HLPs5f4YwltuC W08GWijJAo+1AwEpYs+EXvfyj7K/eNRrmErhQnGZTO6XpfEVuQmbX0BvKT1uy/P/ZTuo p/QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RvL9sQu/aNpw8DUH0zWuQcRzFQAn/CN9Av59oXuUPVY=; b=dwpuG9HVWhWFkTd0oj7pLljsl3z0YEnKpQIVzbWsMouC+IPriukCm1p2NmMHZ8XHWA 9FB5/CHOBzIFcIzNjojKtUx9waUIhkvwaUiZJl4gni8Fb/49fkHDLdXrjVYZvpVYlBdW 5eB5AvjXwcyhMM0diDJsb7taWPsacWG4D0GwkpF8enNnCasm+Mwh9nRHTNJo1KeREnjp P1L2PzgbbL7PqCgectF1lTmSv6txUqq52NVDo8nDvjrdmIVkNsR4WwynILaL1dxGT6LH D4swPpXXWdF6CAbsEirm06H3o7k96/OJNPb2ozUQ7MLIqon6cjALocGIvY76WoXrlTRq 9MRw== X-Gm-Message-State: ALyK8tJTYTO8Q2TU4cyMKnVHD6gA0TGFCkXM5yZHMi7HYlCCYfMkD9jgW9lfda1+Vx/ysw== X-Received: by 10.25.159.194 with SMTP id i185mr1152475lfe.130.1465588558474; Fri, 10 Jun 2016 12:55:58 -0700 (PDT) Received: from tn-HP-4.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id a190sm1377175lfe.21.2016.06.10.12.55.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Jun 2016 12:55:57 -0700 (PDT) From: Tomasz Nowicki To: helgaas@kernel.org, arnd@arndb.de, will.deacon@arm.com, catalin.marinas@arm.com, rafael@kernel.org, hanjun.guo@linaro.org, Lorenzo.Pieralisi@arm.com, okaya@codeaurora.org, jchandra@broadcom.com Subject: [PATCH V9 07/11] PCI: Factor DT specific pci_bus_find_domain_nr() code out Date: Fri, 10 Jun 2016 21:55:15 +0200 Message-Id: <1465588519-11334-8-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465588519-11334-1-git-send-email-tn@semihalf.com> References: <1465588519-11334-1-git-send-email-tn@semihalf.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160610_125617_504519_161E8F96 X-CRM114-Status: GOOD ( 10.01 ) 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: jcm@redhat.com, linaro-acpi@lists.linaro.org, linux-pci@vger.kernel.org, dhdang@apm.com, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, jeremy.linton@arm.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, robert.richter@caviumnetworks.com, cov@codeaurora.org, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, wangyijing@huawei.com, Tomasz Nowicki , mw@semihalf.com, andrea.gallo@linaro.org, linux-arm-kernel@lists.infradead.org, liudongdong3@huawei.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP pci_bus_find_domain_nr() retrieves the host bridge domain number in a DT specific way. Factor our pci_bus_find_domain_nr() in a separate DT function (ie of_pci_bus_find_domain_nr()) so that DT code is self contained, paving the way for retrieving domain number in pci_bus_find_domain_nr() with additional firmware methods (ie ACPI). Signed-off-by: Tomasz Nowicki Reviewed-by: Lorenzo Pieralisi --- drivers/pci/pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index b9a7833..327828d 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4941,7 +4941,7 @@ int pci_get_new_domain_nr(void) } #ifdef CONFIG_PCI_DOMAINS_GENERIC -int pci_bus_find_domain_nr(struct pci_bus *bus, struct device *parent) +static int of_pci_bus_find_domain_nr(struct device *parent) { static int use_dt_domains = -1; int domain = -1; @@ -4987,6 +4987,11 @@ int pci_bus_find_domain_nr(struct pci_bus *bus, struct device *parent) return domain; } + +int pci_bus_find_domain_nr(struct pci_bus *bus, struct device *parent) +{ + return of_pci_bus_find_domain_nr(parent); +} #endif #endif