From patchwork Mon Apr 30 05:48:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 10370845 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 80DFF60540 for ; Mon, 30 Apr 2018 05:54:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 706E6283E7 for ; Mon, 30 Apr 2018 05:54:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 656AC28A14; Mon, 30 Apr 2018 05:54:13 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CBB5E283E7 for ; Mon, 30 Apr 2018 05:54:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wlU01MUxqyd2VldEdkFn2UNcKTP2xsMYv29VK8jG/Nc=; b=mfRZ6V+PSJ12rb Z2dZhzxzMWPcs/hG8ZCxhEUT1bNDgVKbc34b3/pqSkME8iZE6n2PD0jVZVPN6k328Pk7JWE31dDMw afKyV5Id1aqpOWgudvoMliRtAEBR5ah8gB++ZpAJVwtb0WESb0FO6UK1GH4vvjXUuozvhRlrto5hs TUjcPng9Qvs6QopZ+8T3jU3UoNghP85caiP0GLEw9XdofR8eZbjbkCIcjXxW/aJlLrkQ5GE8gYj7u rdJhrHKA9IlP/Wej6YsF40tnSF9H/sD0og8iVHFpeZSuJQsnl2r/dvw8bw6lxxYl8B3J/rIJvTlcg 70foY2X53bDRrzYKQpnQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fD1lC-00061J-9Z; Mon, 30 Apr 2018 05:54:02 +0000 Received: from thoth.sbs.de ([192.35.17.2]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fD1gP-0002j9-9v for linux-arm-kernel@lists.infradead.org; Mon, 30 Apr 2018 05:49:11 +0000 Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w3U5mmeb012495 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Apr 2018 07:48:48 +0200 Received: from md1f2u6c.ww002.siemens.net ([167.87.54.87]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id w3U5mj70003250; Mon, 30 Apr 2018 07:48:48 +0200 From: Jan Kiszka To: Bjorn Helgaas , Linux Kernel Mailing List , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 08/10] PCI: Deprecate of_pci_get_host_bridge_resources() Date: Mon, 30 Apr 2018 07:48:42 +0200 Message-Id: X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180429_224905_700544_E2BE275A X-CRM114-Status: GOOD ( 15.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 From: Jan Kiszka There are no in-tree users remaining, all are converted to the managed variant. And it is unlikely that any out-of-tree user got the resource management right as well. So deprecate the interface and push users to the managed version instead. To avoid raising a warning when exporting a deprecated symbol, wrap the API with an inline and export an internal name. Signed-off-by: Jan Kiszka --- drivers/pci/of.c | 23 ++--------------------- include/linux/of_pci.h | 36 ++++++++++++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 5a88d46a41b7..ccf8c7544e10 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -351,33 +351,14 @@ static int __of_pci_get_host_bridge_resources(struct device *dev, return err; } -/** - * of_pci_get_host_bridge_resources() - Parse PCI host bridge resources from DT - * @dev_node: device node of the host bridge having the range property - * @busno: bus number associated with the bridge root bus - * @bus_max: maximum number of buses for this bridge - * @resources: list where the range of resources will be added after DT parsing - * @io_base: pointer to a variable that will contain on return the physical - * address for the start of the I/O range. Can be NULL if the caller doesn't - * expect I/O ranges to be present in the device tree. - * - * It is the caller's job to free the @resources list. - * - * This function will parse the "ranges" property of a PCI host bridge device - * node and setup the resource mapping based on its content. It is expected - * that the property conforms with the Power ePAPR document. - * - * It returns zero if the range parsing has been successful or a standard error - * value if it failed. - */ -int of_pci_get_host_bridge_resources(struct device_node *dev_node, +int __of_pci_get_host_bridge_resources_deprecated(struct device_node *dev_node, unsigned char busno, unsigned char bus_max, struct list_head *resources, resource_size_t *io_base) { return __of_pci_get_host_bridge_resources(NULL, dev_node, busno, bus_max, resources, io_base); } -EXPORT_SYMBOL_GPL(of_pci_get_host_bridge_resources); +EXPORT_SYMBOL_GPL(__of_pci_get_host_bridge_resources_deprecated); /** * of_pci_get_host_bridge_resources() - Resource-managed parsing of PCI host diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index 08b8f02426a5..c6408bd6f862 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h @@ -71,26 +71,54 @@ of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin) #endif #if defined(CONFIG_OF_ADDRESS) -int of_pci_get_host_bridge_resources(struct device_node *dev_node, +int __of_pci_get_host_bridge_resources_deprecated(struct device_node *dev_node, unsigned char busno, unsigned char bus_max, struct list_head *resources, resource_size_t *io_base); int devm_of_pci_get_host_bridge_resources(struct device *dev, unsigned char busno, unsigned char bus_max, struct list_head *resources, resource_size_t *io_base); #else -static inline int of_pci_get_host_bridge_resources(struct device_node *dev_node, +static inline int devm_of_pci_get_host_bridge_resources(struct device *dev, unsigned char busno, unsigned char bus_max, struct list_head *resources, resource_size_t *io_base) { return -EINVAL; } +#endif -static inline int devm_of_pci_get_host_bridge_resources(struct device *dev, +/** + * of_pci_get_host_bridge_resources() - Parse PCI host bridge resources from DT + * @dev_node: device node of the host bridge having the range property + * @busno: bus number associated with the bridge root bus + * @bus_max: maximum number of buses for this bridge + * @resources: list where the range of resources will be added after DT parsing + * @io_base: pointer to a variable that will contain on return the physical + * address for the start of the I/O range. Can be NULL if the caller doesn't + * expect I/O ranges to be present in the device tree. + * + * It is the caller's job to free the @resources list. + * + * This function will parse the "ranges" property of a PCI host bridge device + * node and setup the resource mapping based on its content. It is expected + * that the property conforms with the Power ePAPR document. + * + * It returns zero if the range parsing has been successful or a standard error + * value if it failed. + * + * Note: This function is deprecated and will eventually be removed. Use + * devm_of_pci_get_host_bridge_resources() instead. + */ +static inline int __deprecated of_pci_get_host_bridge_resources( + struct device_node *dev_node, unsigned char busno, unsigned char bus_max, struct list_head *resources, resource_size_t *io_base) { +#if defined(CONFIG_OF_ADDRESS) + return __of_pci_get_host_bridge_resources_deprecated(dev_node, busno, + bus_max, resources, io_base); +#else return -EINVAL; -} #endif +} #endif