Received: by 10.192.165.148 with SMTP id m20csp3414118imm; Sun, 29 Apr 2018 22:52:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrbNAZ4DonwdvK9c6cNN+c5+NTx8zLmr++V+m4/M73H9p09+oz0TP8A3yQe6DywRgdqYYL9 X-Received: by 2002:a17:902:d882:: with SMTP id b2-v6mr11130458plz.381.1525067529483; Sun, 29 Apr 2018 22:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525067529; cv=none; d=google.com; s=arc-20160816; b=f6cCZZeDFIQHTPJZ/j8EFDkMUwYUzlbpCzlnmSvIEwGBqvgHizlS8hCE4sM0a2h7Ql KD1ws2VRZuZezGrNqHLtljg9q47XBk/dVw2kjJaX8bNmPZkBhPqqQajvgVnL1j3oi4h0 zoYBE9oRGf4Y79qWn41XhBZDNf1wMtjC1rRhj4CRbBLTTSDHWihyrRbYy/jzCPzP+HOT xS5rPW34EZn6N+N2R5XFR3JG11Iaz9rYxZudQcQZWbn6E4yX+SDS1+eETjraV123BrkS 0a8UV1LSCH3z2uHMJ6ABEqA3lw2/qxSJDakRa7f9MIT47cXYG5ca7GVoHOvPK7CNRnho v68Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:to:from :arc-authentication-results; bh=6bquW3XSMjV8rTKW9s31AzAQ2dD3hQ61AMfeieyPmvU=; b=PWzKbGI1sfN/aW9rie0thnjdcyl5/WWFNHGHZN42XeQan+Fms+l/TXbZ4s/GSu3apb aOTT44XtdPkBVWwVWTLHv7IMtfp8Pg6+wLPYOLykmHIy+JKQ+VW4eTRbPGnGMWZkDCjj Ctphl5ohA09vPmNYER2iH7qxXh0DMX6F1fnuX3K3XoQDqdb5uRIcFTU1rXMOIwcteSvt qPRVAhTj/AIHEXW3TEpz8IMXXPzWLlXC9lyhGF2Usli4eWi5sKJtvr744x9lrJnXDTmm AfT8q+Ie7uaf9AfwG7LJsp5I9ZtiGmkHbKQgzpLE3J4stoWGPtPHgkh9LW1YPagUklN9 d0qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7-v6si1375000pgq.305.2018.04.29.22.51.55; Sun, 29 Apr 2018 22:52:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751889AbeD3FtQ (ORCPT + 99 others); Mon, 30 Apr 2018 01:49:16 -0400 Received: from thoth.sbs.de ([192.35.17.2]:41332 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751744AbeD3FtM (ORCPT ); Mon, 30 Apr 2018 01:49:12 -0400 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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.13.6