gpio: mxc: Improve PM configuration
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 11 Jul 2023 07:20:53 +0000 (09:20 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 25 Jul 2023 09:56:25 +0000 (11:56 +0200)
commit6a270bbd3a74c432b867214044377ccfcdb5ddc4
tree8ceb65a66dbe66b0b16f2eb5ad7922c6c0cf49da
parent320630c45e6668c7b9b59489068cd1f85637a6ff
gpio: mxc: Improve PM configuration

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: 3283d820dce649ad ("gpio: mxc: add runtime pm support")
Reported-by: noreply@ellerman.id.au
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-mxc.c