[PATCH] pinctrl: intel: hide unused intel_pin_to_gpio

From: Arnd Bergmann
Date: Fri Sep 06 2019 - 11:26:18 EST


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@xxxxxxxx>
---
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