From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16E1AC00307 for ; Fri, 6 Sep 2019 15:26:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EEC8F2070C for ; Fri, 6 Sep 2019 15:26:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404107AbfIFP0R (ORCPT ); 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 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1: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+QjaU 7/29UxgKfLjnGEKJ5ogRGUCgFqPyzkaNvXWb4u7zHpGjKLSy80= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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); -- 2.20.0