• Geert Uytterhoeven's avatar
    gpio: mxc: Improve PM configuration · 6a270bbd
    Geert Uytterhoeven authored
    If CONFIG_PM=n (e.g. m68k/allmodconfig):
    
        drivers/gpio/gpio-mxc.c:612:12: error: ‘mxc_gpio_runtime_resume’ defined but not used [-Werror=unused-function]
          612 | static int mxc_gpio_runtime_resume(struct device *dev)
              |            ^~~~~~~~~~~~~~~~~~~~~~~
        drivers/gpio/gpio-mxc.c:602:12: error: ‘mxc_gpio_runtime_suspend’ defined but not used [-Werror=unused-function]
          602 | static int mxc_gpio_runtime_suspend(struct device *dev)
              |            ^~~~~~~~~~~~~~~~~~~~~~~~
    
    Fix this by using the non-SET *_PM_OPS to configure the dev_pm_ops
    callbacks, and by wrapping the driver.pm initializer insider pm_ptr().
    
    As NOIRQ_SYSTEM_SLEEP_PM_OPS() uses pm_sleep_ptr() internally, the
    __maybe_unused annotations for the noirq callbacks are no longer needed,
    and can be removed.
    
    Fixes: 3283d820 ("gpio: mxc: add runtime pm support")
    Reported-by: noreply@ellerman.id.au
    Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
    Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
    Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
    6a270bbd
gpio-mxc.c 17.9 KB