From patchwork Mon Aug 15 15:36:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 9281449 X-Patchwork-Delegate: bhelgaas@google.com 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 6558360467 for ; Mon, 15 Aug 2016 15:37:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5751928D25 for ; Mon, 15 Aug 2016 15:37:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A51628D3C; Mon, 15 Aug 2016 15:37:01 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham 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 E2DC128D25 for ; Mon, 15 Aug 2016 15:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753170AbcHOPhA (ORCPT ); Mon, 15 Aug 2016 11:37:00 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34401 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752999AbcHOPg7 (ORCPT ); Mon, 15 Aug 2016 11:36:59 -0400 Received: by mail-pf0-f193.google.com with SMTP id g202so3927527pfb.1; Mon, 15 Aug 2016 08:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tWLokZx+wMMV1LjqZx6YHkLaAiWdnNkLBPFFkWl0MIU=; b=SITocqQvbBaNJpMnaoMJY7KJDxwIGZCPXXk3xHkHVYK60pysQT5nMRjxuVLVAArYml Jeqvna6qRind1JDyr0snMNqK+TtBZpg9xUKYvxGsR4TFIACM5s+jdcqTFGO6GhxN+9/m mdRxx5JfSmFov79bQy744Xn0GvCgePYiZBfnFJpcqWHJgxIQC5c9BGAoz6PX/w+0K+2w MO+YmIQRqZ8IBtBuiTZWmDI2ighH0PysRQ1a/3tZj3ONLt9BlB7b7C6W4iPzPamH18L1 pFAe+OpkwvNbJgmQvoG4Wnjqfa825fWQNAsB10dka8zjHApP9ypfecquMRxAbbQufg56 QkPg== 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=tWLokZx+wMMV1LjqZx6YHkLaAiWdnNkLBPFFkWl0MIU=; b=b43F0OOiYvoRewr6p81MpcBD1WLR9WPObJK6R+EGsEw2rdCmkeEBSd5S0MMeyLImuK 6jdUFtQY74PiJEE0TGblKRu4fh5IpeOOV0YOYk020IgMtpe/4p/SwPNWjPEQ9I/3ptbo 2JqLiRYWoYVX77dMcGKmozLHxcXjJ80Kz8OTTaC1AlI9Uupu0L47/nfTplL3Nj9gtT3z cUcT6NC4wqc1mfAWt8KqG8XJ+7pfM/bbDrHWAj82wFl57hPlj59nnNDFvPqgUsw3PUaI vzSB7/PT31Nd1ep9fjG1jo8MqbKG3Xc+MDMYSccavzF8+Gkj6T7tOmpOqGRlQEW/JLLt CytQ== X-Gm-Message-State: AEkooutXOgzsY1axMPl364Fx8bPJ84y1712Nnp21UwFjlqJvr+Dv+vh53TmGLC2ucNvb8Q== X-Received: by 10.98.35.7 with SMTP id j7mr3912185pfj.39.1471275418450; Mon, 15 Aug 2016 08:36:58 -0700 (PDT) Received: from localhost (port-17579.pppoe.wtnet.de. [46.59.130.70]) by smtp.gmail.com with ESMTPSA id a21sm32370962pfe.81.2016.08.15.08.36.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Aug 2016 08:36:57 -0700 (PDT) From: Thierry Reding To: Bjorn Helgaas Cc: Arnd Bergmann , Tomasz Nowicki , Liviu Dudau , linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v3 3/4] PCI: Make host bridge interface publicly available Date: Mon, 15 Aug 2016 17:36:46 +0200 Message-Id: <20160815153647.1075-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160815153647.1075-1-thierry.reding@gmail.com> References: <20160815153647.1075-1-thierry.reding@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding Allow PCI host bridge drivers to use the new host bridge interfaces to register their host bridge. Signed-off-by: Thierry Reding --- drivers/pci/probe.c | 6 ++++-- include/linux/pci.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index ecf543014da3..4e05e703d1de 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -521,7 +521,7 @@ static void pci_release_host_bridge_dev(struct device *dev) kfree(bridge); } -static struct pci_host_bridge *pci_alloc_host_bridge(size_t priv) +struct pci_host_bridge *pci_alloc_host_bridge(size_t priv) { struct pci_host_bridge *bridge; @@ -536,6 +536,7 @@ static struct pci_host_bridge *pci_alloc_host_bridge(size_t priv) return bridge; } +EXPORT_SYMBOL(pci_alloc_host_bridge); static const unsigned char pcix_bus_speed[] = { PCI_SPEED_UNKNOWN, /* 0 */ @@ -720,7 +721,7 @@ static void pci_set_bus_msi_domain(struct pci_bus *bus) dev_set_msi_domain(&bus->dev, d); } -static int pci_register_host_bridge(struct pci_host_bridge *bridge) +int pci_register_host_bridge(struct pci_host_bridge *bridge) { struct device *parent = bridge->dev.parent; struct resource_entry *window, *n; @@ -835,6 +836,7 @@ free: kfree(bus); return err; } +EXPORT_SYMBOL(pci_register_host_bridge); static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent, struct pci_dev *bridge, int busnr) diff --git a/include/linux/pci.h b/include/linux/pci.h index 3aa7240800c8..2e22ee99c841 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -426,6 +426,8 @@ struct pci_host_bridge { #define to_pci_host_bridge(n) container_of(n, struct pci_host_bridge, dev) +struct pci_host_bridge *pci_alloc_host_bridge(size_t priv); +int pci_register_host_bridge(struct pci_host_bridge *bridge); struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus); void pci_set_host_bridge_release(struct pci_host_bridge *bridge,