Commit 5d05e815 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Alexandre Belloni

rtc: sh: mark PM functions as unused

The sh_rtc_set_irq_wake() function is only called from the suspend/resume handlers
that may be hidden, causing a harmless warning:

drivers/rtc/rtc-sh.c:724:13: error: 'sh_rtc_set_irq_wake' defined but not used [-Werror=unused-function]
 static void sh_rtc_set_irq_wake(struct device *dev, int enabled)

The most reliable way to avoid the warning is to remove the existing #ifdef
and mark the two functions as __maybe_unused so the compiler can silently
drop all three when there is no reference.

Fixes: dab5aec6 ("rtc: sh: add support for rza series")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent e73ef755
...@@ -734,8 +734,7 @@ static void sh_rtc_set_irq_wake(struct device *dev, int enabled) ...@@ -734,8 +734,7 @@ static void sh_rtc_set_irq_wake(struct device *dev, int enabled)
} }
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused sh_rtc_suspend(struct device *dev)
static int sh_rtc_suspend(struct device *dev)
{ {
if (device_may_wakeup(dev)) if (device_may_wakeup(dev))
sh_rtc_set_irq_wake(dev, 1); sh_rtc_set_irq_wake(dev, 1);
...@@ -743,14 +742,13 @@ static int sh_rtc_suspend(struct device *dev) ...@@ -743,14 +742,13 @@ static int sh_rtc_suspend(struct device *dev)
return 0; return 0;
} }
static int sh_rtc_resume(struct device *dev) static int __maybe_unused sh_rtc_resume(struct device *dev)
{ {
if (device_may_wakeup(dev)) if (device_may_wakeup(dev))
sh_rtc_set_irq_wake(dev, 0); sh_rtc_set_irq_wake(dev, 0);
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume); static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume);
......
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