aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-stm32.c
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2023-08-15 15:16:41 -0700
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2023-08-17 00:53:00 +0200
commit2cf2a1acc6ebdffc6363de9156db8737f33c1803 (patch)
treea411e114b859ef23beb3e8bd664624583443321a /drivers/rtc/rtc-stm32.c
parente5aabfbc09ca2037e299e0c2c41235922c39b840 (diff)
downloadlinux-2cf2a1acc6ebdffc6363de9156db8737f33c1803.tar.gz
rtc: stm32: Use NOIRQ_SYSTEM_SLEEP_PM_OPS()
After the switch to SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() and a subsequent fix, stm32_rtc_{suspend,resume}() are unused when CONFIG_PM_SLEEP is not set because SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() is a no-op in that configuration: drivers/rtc/rtc-stm32.c:904:12: error: 'stm32_rtc_resume' defined but not used [-Werror=unused-function] 904 | static int stm32_rtc_resume(struct device *dev) | ^~~~~~~~~~~~~~~~ drivers/rtc/rtc-stm32.c:894:12: error: 'stm32_rtc_suspend' defined but not used [-Werror=unused-function] 894 | static int stm32_rtc_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors The non-"SET_" version of this macro, NOIRQ_SYSTEM_SLEEP_PM_OPS(), is designed to handle this situation by only assigning the callbacks when CONFIG_PM_SLEEP is set while allowing the functions to appear used to the compiler. Switch to that macro to resolve the warnings. There is no functional change with this, as SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() is defined using NOIRQ_SYSTEM_SLEEP_PM_OPS() when CONFIG_PM_SLEEP is set. Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20230815-rtc-stm32-unused-pm-funcs-v1-1-82eb8e02d903@kernel.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-stm32.c')
-rw-r--r--drivers/rtc/rtc-stm32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
index 3ce4b3d08155b..76753c71d92ee 100644
--- a/drivers/rtc/rtc-stm32.c
+++ b/drivers/rtc/rtc-stm32.c
@@ -923,7 +923,7 @@ static int stm32_rtc_resume(struct device *dev)
}
static const struct dev_pm_ops stm32_rtc_pm_ops = {
- SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(stm32_rtc_suspend, stm32_rtc_resume)
+ NOIRQ_SYSTEM_SLEEP_PM_OPS(stm32_rtc_suspend, stm32_rtc_resume)
};
static struct platform_driver stm32_rtc_driver = {