From patchwork Mon Dec 19 19:20:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 34727 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2573463wrn; Mon, 19 Dec 2022 11:23:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXtX4ivPV43hco6NhteKlBFDdlSTD7Ho/20PAzmXsSo7/MYdVxQG5diX+Uqzydt7YB1JSce4 X-Received: by 2002:a17:90a:43a7:b0:223:9a8c:70d5 with SMTP id r36-20020a17090a43a700b002239a8c70d5mr13069491pjg.28.1671477785436; Mon, 19 Dec 2022 11:23:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671477785; cv=none; d=google.com; s=arc-20160816; b=g+2iL8WhIiJTxxgJBWZCDP2rPfBKymRbr7nJDkkprarNfK8P2rMTzFL8o6zX7+AK10 ZXrwjDk2HtHq+8lKipaKnMdhLLZuniXP+OoGDLOaGFmjdQxiXJE5cwUe3udjRo2B4HXx E1sd0/wMx3mgJbO2HIsVrCNYZ011ocKtS104BY5tQpBRvOG/Yc9dQbOQfNpe1uZ/xEeG hho778YS6/ovALtpi3K1IbmXJZ/IqrbNySAcE0TK7jtSs0mbQUxNiEt9LgQsgM3pDesO D/+/zsy1yvK0iD/ZG8aVDPZGg1eMIL2B5nZWNukAWXS3nDWn4XuS/zyAuLTXQxYDkrwB sl3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rTlUHMQAwjLi947gmhUW7QqFF5pDNu/GVVsBTdlEvDc=; b=DfnnDEF0GHmeOtuMpXAIwnz1gVJ0ADcsknCjplkjixYwx6m5dYjwkzlW67YI3XcA7H X3DxsDo3tJemwHXli+yhaKJ60GM47ZtaBzPVzkX62Y1VDpcvbolxxmKKXnsXweq/tsLY 9LZ7A6cxTCXE7LBUp0hZStjFakDxN02m4aFOC7oWsk8h/IbPArRoGDErVSQnDVr3gGFI OgSyds1PqPWwTdUwryq9qK3X8/73GjK5p1/Rfb1BkykxYrb3zEy00pK6SrYcLkWlC/Qy WDW9sUbE97PVRbuDkGIVh6pNNOkx8v5yvAZefHK5A4fSRPzMUtohXMZSxRfbdnSvdt3K jOuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Z0xpP8n2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v13-20020a17090a520d00b00219c6a4b550si15421602pjh.103.2022.12.19.11.22.52; Mon, 19 Dec 2022 11:23:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Z0xpP8n2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232489AbiLSTWM (ORCPT + 99 others); Mon, 19 Dec 2022 14:22:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232684AbiLSTVr (ORCPT ); Mon, 19 Dec 2022 14:21:47 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 158511704D; Mon, 19 Dec 2022 11:20:23 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id a9so9981215pld.7; Mon, 19 Dec 2022 11:20:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rTlUHMQAwjLi947gmhUW7QqFF5pDNu/GVVsBTdlEvDc=; b=Z0xpP8n27UOvhgOKqawE8G+NcZ4CkicUeK0lsXh7p3SzVNgwQsyPRfYQ4X61bpP4vO 8XBuLnuBaZTmd+XL1fIymeJ8ad1SZvsdZN/syXaUhoo8zNE0xcqIBWT1XN+nZgwnb0IO Dn+HyrT23P7MoX+9aUkxY5gtiitPdN70VlHKEivWuB5oPYHUcRUSIdifDD73AmQLQFHL zXZk0R6SCyZSgK/fuMkcKeBv7Pky2VgCFxBDPkA3Pq2qDyjqnL1Hpd60BZi8RhbxltFZ yFMpfflLCCPy0LqVyPUQ7T0aCRk6iAeQLte2r4I3hD2GulFh8/vYplW0gcWiSfw+OWcs fe8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rTlUHMQAwjLi947gmhUW7QqFF5pDNu/GVVsBTdlEvDc=; b=dgrvBiQJU2j0qp/SE0Mlwz8aLkY+y/4G2RV6rkPDeAr2z0rzlm8RWDvvK9qzL3pXOG V5RkqYvoOAaAiNhi/5J7cSQOTzUkTtGqrmb4kQjdG4bdMZweYeQbUKKiM0BDpMgda0fe TOGv/cq3a7/dkMhe+hfk1X/45/OgHn7T68sJLS1gmIQoaoYxEr4UIa3vffiS35ZzvMYb nC8uIOEAOwPqEofKKhBcVsJrPEPebHLS1P3ZMXxoUtqggibmwQNNcR4fx1cre7Za+fCW XaanWxx0qfRxFNGrmqCX/PdBonKZcoG0hbZ2JtgdYZFL2KbNnadWjh6f3jlU06y0Bu8i mKaA== X-Gm-Message-State: ANoB5pnYWB+pD3nxkPBVwS9qxrmnGc4H8Jwp9bXDP6zo1kjCG87J+aQW vRBc8OKbHHXw7HmcPzQsS8I= X-Received: by 2002:a17:902:bc89:b0:18f:8f1e:e69f with SMTP id bb9-20020a170902bc8900b0018f8f1ee69fmr33904903plb.19.1671477622441; Mon, 19 Dec 2022 11:20:22 -0800 (PST) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:4c62:79e:b4cd:2cbb]) by smtp.gmail.com with ESMTPSA id b6-20020a1709027e0600b001869f2120absm7488342plm.294.2022.12.19.11.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 11:20:21 -0800 (PST) From: Dmitry Torokhov To: Linus Walleij , Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: [PATCH 2/5] gpiolib: of: stop exporting of_gpio_named_count() Date: Mon, 19 Dec 2022 11:20:13 -0800 Message-Id: <20221219192016.1396950-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20221219192016.1396950-1-dmitry.torokhov@gmail.com> References: <20221219192016.1396950-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752671490266491017?= X-GMAIL-MSGID: =?utf-8?q?1752671490266491017?= The only user of this function is gpiolib-of.c so move it there. Signed-off-by: Dmitry Torokhov Reviewed-by: Andy Shevchenko --- drivers/gpio/gpiolib-of.c | 26 ++++++++++++++++++++++++++ include/linux/of_gpio.h | 26 -------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 4fff7258ee41..6724e375678d 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -23,6 +23,32 @@ #include "gpiolib.h" #include "gpiolib-of.h" +/** + * of_gpio_named_count() - Count GPIOs for a device + * @np: device node to count GPIOs for + * @propname: property name containing gpio specifier(s) + * + * The function returns the count of GPIOs specified for a node. + * Note that the empty GPIO specifiers count too. Returns either + * Number of gpios defined in property, + * -EINVAL for an incorrectly formed gpios property, or + * -ENOENT for a missing gpios property + * + * Example: + * gpios = <0 + * &gpio1 1 2 + * 0 + * &gpio2 3 4>; + * + * The above example defines four GPIOs, two of which are not specified. + * This function will return '4' + */ +static int of_gpio_named_count(const struct device_node *np, + const char *propname) +{ + return of_count_phandle_with_args(np, propname, "#gpio-cells"); +} + /** * of_gpio_spi_cs_get_count() - special GPIO counting for SPI * @dev: Consuming device diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index 39f16a960565..680025c1a55b 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h @@ -79,32 +79,6 @@ static inline int of_get_named_gpio_flags(const struct device_node *np, #endif /* CONFIG_OF_GPIO */ -/** - * of_gpio_named_count() - Count GPIOs for a device - * @np: device node to count GPIOs for - * @propname: property name containing gpio specifier(s) - * - * The function returns the count of GPIOs specified for a node. - * Note that the empty GPIO specifiers count too. Returns either - * Number of gpios defined in property, - * -EINVAL for an incorrectly formed gpios property, or - * -ENOENT for a missing gpios property - * - * Example: - * gpios = <0 - * &gpio1 1 2 - * 0 - * &gpio2 3 4>; - * - * The above example defines four GPIOs, two of which are not specified. - * This function will return '4' - */ -static inline int of_gpio_named_count(const struct device_node *np, - const char *propname) -{ - return of_count_phandle_with_args(np, propname, "#gpio-cells"); -} - static inline int of_get_gpio_flags(const struct device_node *np, int index, enum of_gpio_flags *flags) {