From patchwork Mon May 21 20:57:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 10416345 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 DCCDA6053B for ; Mon, 21 May 2018 20:59:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAB3628A58 for ; Mon, 21 May 2018 20:59:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF53328A64; Mon, 21 May 2018 20:59:59 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, 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 24AF528A63 for ; Mon, 21 May 2018 20:59:59 +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:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=mjWYkCWHX+hkTGGd8hOQ/MvThPOJx0A+YLeow5ILwK0=; b=coFUsUkImhIY4pMxtdiTU/4vp2 EDchfmTE+Sk5L2GSXB0rJHndmFi7Kn6PSJMgOAoY9tzM3Td3k0np6Pf1RP39q/ScJquunnt39xeNw fs6V8jdDHejjlkL709clc44U39RMdatMR4lqiyOedNhvAB65ifHxk6Ie7ypMxnNn6QVFZiGgmHIFZ jNHgwW74rYB/Bv77TBFOUMSXWUehSykbex7f7eeotkG9cMivNu8y3kzsdC1+ZjX7zmQWeKDHyTdpP U5ZZX+tkuBygIUxjP7zt6mn/8yIulvxIoN8k5XNfFoKZQTgZTpNfHYeYd5v4uJsXeDqhDro4TNBCM uuWPHrzw==; 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 1fKruD-0001GI-7B; Mon, 21 May 2018 20:59:45 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fKrsS-0008Qg-EM for linux-arm-kernel@lists.infradead.org; Mon, 21 May 2018 20:58:22 +0000 Received: by mail-wr0-x244.google.com with SMTP id i14-v6so17302138wre.2 for ; Mon, 21 May 2018 13:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=eaizejlibJlYozTqdHPUtzY/WRFahGx1Bc8UcJQWkE4=; b=Z32KdykSOSXb5MDh6xVbdR0d+QXTWWcR5X/ybvWQHfmCb2AZ3uFdqKU+VulHpvGaJF egStLL1wyZlV+NlNQsW7JWYd0BFwniKcuz3NICEPsjkyHHJIi5Gz5z8+0VD32oIZB8gk J2jfBu0UAelh4KOF4vWiJOU07d6uwRQhjY7IqmDRFqaH5GZIEqyMMMe61Uy7Mei+HF/F 5pra731G+V7HiSgoP58PfNoTHWhluWtwjt8uqTZ2RAFLxEgbkwSFAbxY6+Fu6T4u14l2 Z7KEQb688t6LWLCgKTVjdl0HsoZJqwqt88N1mLc6IB552NeB4a+B95wqUjwVmOy/K7Bh Rmqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=eaizejlibJlYozTqdHPUtzY/WRFahGx1Bc8UcJQWkE4=; b=HfxGhxl1HyrXTTRmi9bb/XakG5d7v5bknlYReJge7O1OvuYOlB9c/UiMh4JmG3ola2 zRldkzqCq9NzOCDgfNHEj920a91cEgQSSN+Q3HeHds9LFCiU6+g9rMKZ/yxpXzEjcMv5 YaO/GeZ3j/wYAf29Pxz7ecBKRk6TJnVkzwn8N22Hc7BVcc9hhl7LSEhCTZ9FIOEwYt7/ cIefBzTO0oyDMZeL5a4U4MbNiqsFfY5jReaiF44O8xLCOfbNX3ME77Qj+bs76czP8aOt REeR1nTEW1NiXh9Dh7lJE5sDyEOty01mqqxRYQri++vS7hqoGWkGfnuMezYN3p2F0Gmm oh0g== X-Gm-Message-State: ALKqPwco0ZP9QC+9nQ0OYGNOk7SCyIVLYC9hZsZ+xwzBbVQ7Y4JjXB0k I56Z5qV49hhZVSmqQ8hviHUIM+xT X-Google-Smtp-Source: AB8JxZr7Jw39xVyQVTKvS6gTC9Fr390hPVSYq9ekWlsU8VuKZkzAjkpFoRM86WlOE/ezrB+BVyo0Qg== X-Received: by 2002:adf:9125:: with SMTP id j34-v6mr4080636wrj.156.1526936263560; Mon, 21 May 2018 13:57:43 -0700 (PDT) Received: from debian64.daheim (p5B0D7D7A.dip0.t-ipconnect.de. [91.13.125.122]) by smtp.gmail.com with ESMTPSA id x16-v6sm5425513wmc.2.2018.05.21.13.57.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 May 2018 13:57:41 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1fKrsD-000653-2A; Mon, 21 May 2018 22:57:41 +0200 From: Christian Lamparter To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v5 4/4] gpiolib: discourage gpiochip_add_pin[group]_range for DT pinctrls Date: Mon, 21 May 2018 22:57:39 +0200 Message-Id: <2969992a1005d7e7f4ea23d4c684d2f10d4a0aca.1526935804.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <910e5a85a6a8020069996e2ff397c93e9c5fe18c.1526935804.git.chunkeey@gmail.com> References: <910e5a85a6a8020069996e2ff397c93e9c5fe18c.1526935804.git.chunkeey@gmail.com> In-Reply-To: <0ae3376606a89bcdf3fe753a5c967f7103699e09.1526935804.git.chunkeey@gmail.com> References: <910e5a85a6a8020069996e2ff397c93e9c5fe18c.1526935804.git.chunkeey@gmail.com> <270904bcbf03a6b6ac3150f4a7daa15aa7e97586.1526935804.git.chunkeey@gmail.com> <0ae3376606a89bcdf3fe753a5c967f7103699e09.1526935804.git.chunkeey@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180521_135756_510031_3F795360 X-CRM114-Status: GOOD ( 16.34 ) 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: , Cc: Mark Rutland , Stephen Boyd , Linus Walleij , Bjorn Andersson , David Brown , Rob Herring , Sven Eckelmann , Andy Gross 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 This patch adds the stern warning to the kerneldoc text of both gpiochip_add_pin[group]_range() functions in hope of detering developers from ever using them in their DeviceTree-supported pinctrl drivers in the future. For anyone affected: Please refer to Section 2.1 of Documentation/devicetree/bindings/gpio/gpio.txt on how to bind pinctrl and gpio drivers via the "gpio-ranges" property. Signed-off-by: Christian Lamparter --- As a (final?) follow-up to Stephen's request of adding a warning to notify devs and users alike about any potentially broken drivers: of_gpiochip_add_pin_range() - which parses the gpio-ranges property - calls both gpiochip_add_pin(group)_range functions. So adding a warning/debug message into the code will not really work (unless the DT-check will also take the call-trace into account... which is possible, but at this point it would make more sense to just refactor the code). --- drivers/gpio/gpiolib.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index d1171db66c30..387bf0677ca8 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2117,6 +2117,11 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_config); * @pctldev: the pin controller to map to * @gpio_offset: the start offset in the current gpio_chip number space * @pin_group: name of the pin group inside the pin controller + * + * Calling this function directly from a DeviceTree-supported + * pinctrl driver is DEPRECATED. Please see Section 2.1 of + * Documentation/devicetree/bindings/gpio/gpio.txt on how to + * bind pinctrl and gpio drivers via the "gpio-ranges" property. */ int gpiochip_add_pingroup_range(struct gpio_chip *chip, struct pinctrl_dev *pctldev, @@ -2170,6 +2175,11 @@ EXPORT_SYMBOL_GPL(gpiochip_add_pingroup_range); * * Returns: * 0 on success, or a negative error-code on failure. + * + * Calling this function directly from a DeviceTree-supported + * pinctrl driver is DEPRECATED. Please see Section 2.1 of + * Documentation/devicetree/bindings/gpio/gpio.txt on how to + * bind pinctrl and gpio drivers via the "gpio-ranges" property. */ int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, unsigned int gpio_offset, unsigned int pin_offset,