public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: intel: hide unused intel_pin_to_gpio
@ 2019-09-06 15:26 Arnd Bergmann
  2019-09-06 16:59 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2019-09-06 15:26 UTC (permalink / raw)
  To: Mika Westerberg, Andy Shevchenko, Linus Walleij
  Cc: Arnd Bergmann, Chris Chiu, Kai-Heng Feng, linux-gpio,
	linux-kernel

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 <arnd@arndb.de>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-06 18:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-06 15:26 [PATCH] pinctrl: intel: hide unused intel_pin_to_gpio Arnd Bergmann
2019-09-06 16:59 ` Andy Shevchenko
2019-09-06 18:52   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox