gpio: intel-mid: Fix build warning when !CONFIG_PM
authorAugusto Mecking Caringi <augustocaringi@gmail.com>
Mon, 16 Jan 2017 14:30:41 +0000 (14:30 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 26 Jan 2017 09:00:20 +0000 (10:00 +0100)
The only usage of function intel_gpio_runtime_idle() is here (in the
same file):

static const struct dev_pm_ops intel_gpio_pm_ops = {
SET_RUNTIME_PM_OPS(NULL, NULL, intel_gpio_runtime_idle)
};

And when CONFIG_PM is not set, the macro SET_RUNTIME_PM_OPS expands to
nothing, causing the following compiler warning:

drivers/gpio/gpio-intel-mid.c:324:12: warning: ‘intel_gpio_runtime_idle’
defined but not used [-Wunused-function]
static int intel_gpio_runtime_idle(struct device *dev)

Fix it by annotating the function with __maybe_unused.

Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-intel-mid.c

index a1e44c221f66b6283a19a2e5c4564a336a15dbf2..b76ecee82c3fd6b08fc9e0da65bc9a1eda5461d4 100644 (file)
@@ -321,7 +321,7 @@ static void intel_mid_irq_init_hw(struct intel_mid_gpio *priv)
        }
 }
 
-static int intel_gpio_runtime_idle(struct device *dev)
+static int __maybe_unused intel_gpio_runtime_idle(struct device *dev)
 {
        int err = pm_schedule_suspend(dev, 500);
        return err ?: -EBUSY;