Commit f7fc5768 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Linus Walleij

pinctrl: s32cc: fix !CONFIG_PM_SLEEP build error

The declaration of s32_pinctrl_suspend/s32_pinctrl_resume is hidden
in an #ifdef, causing a compilation failure when CONFIG_PM_SLEEP is
disabled:

drivers/pinctrl/nxp/pinctrl-s32g2.c:754:38: error: 's32_pinctrl_suspend' undeclared here (not in a function); did you mean 's32_pinctrl_probe'?
drivers/pinctrl/nxp/pinctrl-s32g2.c:754:9: note: in expansion of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
  754 |         SET_LATE_SYSTEM_SLEEP_PM_OPS(s32_pinctrl_suspend,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Remove the bogus #ifdef and __maybe_unused annation on the global
functions, and instead use the proper LATE_SYSTEM_SLEEP_PM_OPS()
macro to pick set the function pointer.

As the function definition is still in the #ifdef block, this leads
to the correct code in all configurations.

Fixes: fd84aaa8 ("pinctrl: add NXP S32 SoC family support")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230310140250.359147-1-arnd@kernel.orgSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 3f2d4560
......@@ -68,8 +68,6 @@ struct s32_pinctrl_soc_info {
int s32_pinctrl_probe(struct platform_device *pdev,
struct s32_pinctrl_soc_info *info);
#ifdef CONFIG_PM_SLEEP
int __maybe_unused s32_pinctrl_resume(struct device *dev);
int __maybe_unused s32_pinctrl_suspend(struct device *dev);
#endif
int s32_pinctrl_resume(struct device *dev);
int s32_pinctrl_suspend(struct device *dev);
#endif /* __DRIVERS_PINCTRL_S32_H */
......@@ -658,7 +658,7 @@ static bool s32_pinctrl_should_save(struct s32_pinctrl *ipctl,
return false;
}
int __maybe_unused s32_pinctrl_suspend(struct device *dev)
int s32_pinctrl_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct s32_pinctrl *ipctl = platform_get_drvdata(pdev);
......@@ -685,7 +685,7 @@ int __maybe_unused s32_pinctrl_suspend(struct device *dev)
return 0;
}
int __maybe_unused s32_pinctrl_resume(struct device *dev)
int s32_pinctrl_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct s32_pinctrl *ipctl = platform_get_drvdata(pdev);
......
......@@ -751,8 +751,7 @@ static int s32g_pinctrl_probe(struct platform_device *pdev)
}
static const struct dev_pm_ops s32g_pinctrl_pm_ops = {
SET_LATE_SYSTEM_SLEEP_PM_OPS(s32_pinctrl_suspend,
s32_pinctrl_resume)
LATE_SYSTEM_SLEEP_PM_OPS(s32_pinctrl_suspend, s32_pinctrl_resume)
};
static struct platform_driver s32g_pinctrl_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment