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: 9170359 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 07EC1607DA for ; Fri, 10 Jun 2016 19:57:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED7B8282F9 for ; Fri, 10 Jun 2016 19:57:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1C4326E5D; Fri, 10 Jun 2016 19:57:27 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C146282F9 for ; Fri, 10 Jun 2016 19:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752323AbcFJT4C (ORCPT ); Fri, 10 Jun 2016 15:56:02 -0400 Received: from mail-lf0-f52.google.com ([209.85.215.52]:35616 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932431AbcFJT4A (ORCPT ); Fri, 10 Jun 2016 15:56:00 -0400 Received: by mail-lf0-f52.google.com with SMTP id u74so52308357lff.2 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=M7cHs0BprlyPX0Rn4FdOn12ku8dyk2wIW4viY9304NUfAOJo1u0gIOMYCyWb5W+WqQ ImNvQuWTqchJwnM9zSYX5KFP3CKCx8XdwUBd98354P0GlViURoXY4VYJVEUkXj7PD6U9 EXmztx0/xIyphCrWpJCjz2Y01cgKeYM0Eex1K7PiGPFtTTNcoYwCIPOvbcXynjvOapM5 ajINQfGi8P25iHhw0X/hLjt8kz4roLJg8S/cao/Tz6tAB6xyCgT/nYh53MkXMpCaX0ry gMTYuQKXUdyGcGCX5CIu3ImgXV8xblspQUw+jDBWaBiYulB+GHVKH5Pui6YrQ/NwT1Aq aLqw== X-Gm-Message-State: ALyK8tK1IRM4nWGBvF9pdk7la+Ws9bPpFZ2AqKRY8HNf/NSUemvWfATJYjV4vpCxZCRv3g== 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 Cc: robert.richter@caviumnetworks.com, mw@semihalf.com, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, wangyijing@huawei.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, jcm@redhat.com, andrea.gallo@linaro.org, dhdang@apm.com, jeremy.linton@arm.com, liudongdong3@huawei.com, cov@codeaurora.org, Tomasz Nowicki 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> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.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