From patchwork Fri Sep 6 15:26:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 173258 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp867245ilq; Fri, 6 Sep 2019 08:26:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqywMDVaKKIJeyw3riBa/Ceoy4QSwhRdzs0G/s7bJGRLVOIGIzjrglEGhYJYmUcYQF+ATn4M X-Received: by 2002:a17:902:7886:: with SMTP id q6mr10022186pll.78.1567783578580; Fri, 06 Sep 2019 08:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567783578; cv=none; d=google.com; s=arc-20160816; b=cA2/lmjCGaJaotKPlrEy4QpHLeglhFEGpMw1jcZZgV0YET65Lg2EYz9px1eEzTYu75 0R+H1tPSOU2wQ242F3wHDWIAQhtJD42FVQ9xbDUY4w47CgwWddXvnk3CCRMf8UMahosr xNm4jrK9etp7I98yVqjNo6PhsQeUDay7+/WtJIGpnG19KxOfvyA1vB6aehMZvoe1+zbK SumNhQxDX5e3dGUw3tkGbratkvj+ytG941v+zElrci2Rz7Ui295vEW/ONHKriSsXJ0V8 TyahGsvB5x+X1cmq8jFlAupi1uyTX1qZBAQdA7OAvd0+xhYS7F/IxQhDFLXt5EmWu+ZA zleA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=1WxwYvyTmAnpG83AB3Dds+/4wnzv/HEkO/S9+V8duJc=; b=ad+oqLORYM7btE8EQ853lvOBZ75xbEcwo287M7vMpYur9nshWuM7QjAsULjshVlwv/ d88eIX5AchHkgBKUlXBCDpLsnh5ExEK8KIHRceSK4/7fd873stuDINqNvUrEDKhE2nCv HuY7CVSRYH3Ew7Z/UuVwLDeFQlI3PClgfwqCJAnCfuC6Yqa1qnRTD3Dim7oo0xgn4/F5 pucZqccPrvhHu9hSfqZW3LMQDMqpfR46VA67z3GYa63dq79SoXUIxFp+tx+3n2NXM2WH 5DPC8ba24NiUgry9/riR5erouk1mhAeCLw2FBBMWsNs11t4HVuIRKWeirzyHRr4vbTr8 zZQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-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 r13si4502213pgn.420.2019.09.06.08.26.17; Fri, 06 Sep 2019 08:26:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731738AbfIFP0R (ORCPT + 5 others); Fri, 6 Sep 2019 11:26:17 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:51663 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbfIFP0R (ORCPT ); Fri, 6 Sep 2019 11:26:17 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1N3bjH-1iEohF3GeB-010cLz; Fri, 06 Sep 2019 17:26:10 +0200 From: Arnd Bergmann To: Mika Westerberg , Andy Shevchenko , Linus Walleij Cc: Arnd Bergmann , Chris Chiu , Kai-Heng Feng , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: intel: hide unused intel_pin_to_gpio Date: Fri, 6 Sep 2019 17:26:01 +0200 Message-Id: <20190906152609.1603386-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:AiaKs1hcEO1fque6w/E9Anh66wK4Q7pzqtqbUXPbfMjkxkZpJhj gRJeh3Irz/R8XadEwis9bcv1tG2oIDpk75Me9ErHiSBXCDBrvL+uMIzQAifh0k3WNRHlDho Mk42z6/tjP+shaHiPj6mafMnbgSx4Jv9PoKOtige2XWj584zvNW1TJu55u3kwfiG97MVCB8 dWdx8ZPbqKo2OK2A1Z+Kg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:OrqLmJTU00I=:davTVrMu33y8hmRr6QShJF dRv7bHz1iAPK9mbk80pWgEZCvw0ACxLMC5DvefJ6sBzsi6KLVEgaWDhlb6qM2n8uF307AKvOu /0l6r9gRgI4+DEbtR/DIwr78B7kdzkmOOv3lRWI0g9tzYo5dJBAps8Itf7gsjkrNlfx1O1v3Q hmUmAoHf0OAhpINoOuM+/OMcC0/hz5maJCbBTmdpGjHad7q2O5dBOFvbmCnXcM8X3JTyNDBWH T1/hmmaAbgF18z11vrXtDCy2prSlM7ytJQBJTMBmfukvCcskXt48wwuqUFiFlAwLw+OQ7ldEW L68ZJzoc8rOPu4LOriXpLQyhKkbVskQbk1OzXOUXWfYU2Y5DHFLPZWU9QWv1UCGGh6Ct67Zqf QqpjQcpktlRWl6TnoiFM5yLcoBdNr4PZ0T1DzGsucBteFSiwsBUGpAjG7LLrXrCBlpCKaQ7du OwOaYtwa0XMQEF7mAAphByjIb8wm3HlAytX9d0GNfn65EtmwqBN2PwW1NldR5mb4cI1xndd9S 4A1piJ6M2zraYL5W2PDfzgtSxmfcjfyVbJrvdOkKsD4b77RP2VkyrDQuvUsmJCQ0o+sz47sQa 8nB33N6SMNQjKCqiE8UJYDp+asIsCx/GKkRu7+Byt+7YxSOQEiDtyH7NuYoh9fONVCWc6Zqq0 PdlqzQXD8upPfr0Pnz93REhQsIxSRTkw41gYX+du39AcTk3W67l+cfCNbx924e2vzqs2dU9vi jUxymNahBkGscLbZE/2rrd6ElByhBnygGRPwkMAMq8+PmyE995QCdbOK+9xDgiAW5I6v+QjaU 7/29UxgKfLjnGEKJ5ogRGUCgFqPyzkaNvXWb4u7zHpGjKLSy80= Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The intel_pin_to_gpio() function is only called by the PM support functions and causes a warning when those are disabled: drivers/pinctrl/intel/pinctrl-intel.c:841:12: error: unused function 'intel_pin_to_gpio' [-Werror,-Wunused-function] As we cannot change the PM functions themselves to use __maybe_unused, add another #ifdef here for consistency. Signed-off-by: Arnd Bergmann --- drivers/pinctrl/intel/pinctrl-intel.c | 46 +++++++++++++-------------- 1 file changed, 23 insertions(+), 23 deletions(-) -- 2.20.0 diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index d66fe2b4221b..67f392174090 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -831,29 +831,6 @@ static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset, return -EINVAL; } -/** - * intel_pin_to_gpio() - Translate from pin number to GPIO offset - * @pctrl: Pinctrl structure - * @pin: pin number - * - * Translate the pin number of pinctrl to GPIO offset - */ -static int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin) -{ - const struct intel_community *community; - const struct intel_padgroup *padgrp; - - community = intel_get_community(pctrl, pin); - if (!community) - return -EINVAL; - - padgrp = intel_community_get_padgroup(community, pin); - if (!padgrp) - return -EINVAL; - - return pin - padgrp->base + padgrp->gpio_base; -} - static int intel_gpio_get(struct gpio_chip *chip, unsigned int offset) { struct intel_pinctrl *pctrl = gpiochip_get_data(chip); @@ -1477,6 +1454,29 @@ int intel_pinctrl_probe_by_uid(struct platform_device *pdev) EXPORT_SYMBOL_GPL(intel_pinctrl_probe_by_uid); #ifdef CONFIG_PM_SLEEP +/** + * intel_pin_to_gpio() - Translate from pin number to GPIO offset + * @pctrl: Pinctrl structure + * @pin: pin number + * + * Translate the pin number of pinctrl to GPIO offset + */ +static int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin) +{ + const struct intel_community *community; + const struct intel_padgroup *padgrp; + + community = intel_get_community(pctrl, pin); + if (!community) + return -EINVAL; + + padgrp = intel_community_get_padgroup(community, pin); + if (!padgrp) + return -EINVAL; + + return pin - padgrp->base + padgrp->gpio_base; +} + static bool intel_pinctrl_should_save(struct intel_pinctrl *pctrl, unsigned int pin) { const struct pin_desc *pd = pin_desc_get(pctrl->pctldev, pin);