diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2023-07-11 09:20:53 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-07-25 11:56:25 +0200 |
commit | 6a270bbd3a74c432b867214044377ccfcdb5ddc4 (patch) | |
tree | 8ceb65a66dbe66b0b16f2eb5ad7922c6c0cf49da /drivers/gpio | |
parent | dt-bindings: gpio: snps,dw-apb: allow gpio-line-names (diff) | |
download | linux-6a270bbd3a74c432b867214044377ccfcdb5ddc4.tar.xz linux-6a270bbd3a74c432b867214044377ccfcdb5ddc4.zip |
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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-mxc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index 443f3e4d9aff..377d3ab8d626 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -622,7 +622,7 @@ static int mxc_gpio_runtime_resume(struct device *dev) return 0; } -static int __maybe_unused mxc_gpio_noirq_suspend(struct device *dev) +static int mxc_gpio_noirq_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct mxc_gpio_port *port = platform_get_drvdata(pdev); @@ -633,7 +633,7 @@ static int __maybe_unused mxc_gpio_noirq_suspend(struct device *dev) return 0; } -static int __maybe_unused mxc_gpio_noirq_resume(struct device *dev) +static int mxc_gpio_noirq_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct mxc_gpio_port *port = platform_get_drvdata(pdev); @@ -646,8 +646,8 @@ static int __maybe_unused mxc_gpio_noirq_resume(struct device *dev) } static const struct dev_pm_ops mxc_gpio_dev_pm_ops = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mxc_gpio_noirq_suspend, mxc_gpio_noirq_resume) - SET_RUNTIME_PM_OPS(mxc_gpio_runtime_suspend, mxc_gpio_runtime_resume, NULL) + NOIRQ_SYSTEM_SLEEP_PM_OPS(mxc_gpio_noirq_suspend, mxc_gpio_noirq_resume) + RUNTIME_PM_OPS(mxc_gpio_runtime_suspend, mxc_gpio_runtime_resume, NULL) }; static int mxc_gpio_syscore_suspend(void) @@ -694,7 +694,7 @@ static struct platform_driver mxc_gpio_driver = { .name = "gpio-mxc", .of_match_table = mxc_gpio_dt_ids, .suppress_bind_attrs = true, - .pm = &mxc_gpio_dev_pm_ops, + .pm = pm_ptr(&mxc_gpio_dev_pm_ops), }, .probe = mxc_gpio_probe, }; |