diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-04-19 13:52:43 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-04-22 12:01:15 -0400 |
commit | 5d05e81516cfe7606ee0cd8278fe225314dccfbe (patch) | |
tree | c371ff6cfe873e431cbe6b3499e06ed902ca7223 | |
parent | e73ef755fbb90b04f0cf494071b2be6bafcafbdc (diff) |
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: dab5aec64bf5 ("rtc: sh: add support for rza series")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-rw-r--r-- | drivers/rtc/rtc-sh.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index 00b396e96cbe..6c2d3989f967 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c | |||
@@ -734,8 +734,7 @@ static void sh_rtc_set_irq_wake(struct device *dev, int enabled) | |||
734 | } | 734 | } |
735 | } | 735 | } |
736 | 736 | ||
737 | #ifdef CONFIG_PM_SLEEP | 737 | static int __maybe_unused sh_rtc_suspend(struct device *dev) |
738 | static int sh_rtc_suspend(struct device *dev) | ||
739 | { | 738 | { |
740 | if (device_may_wakeup(dev)) | 739 | if (device_may_wakeup(dev)) |
741 | sh_rtc_set_irq_wake(dev, 1); | 740 | sh_rtc_set_irq_wake(dev, 1); |
@@ -743,14 +742,13 @@ static int sh_rtc_suspend(struct device *dev) | |||
743 | return 0; | 742 | return 0; |
744 | } | 743 | } |
745 | 744 | ||
746 | static int sh_rtc_resume(struct device *dev) | 745 | static int __maybe_unused sh_rtc_resume(struct device *dev) |
747 | { | 746 | { |
748 | if (device_may_wakeup(dev)) | 747 | if (device_may_wakeup(dev)) |
749 | sh_rtc_set_irq_wake(dev, 0); | 748 | sh_rtc_set_irq_wake(dev, 0); |
750 | 749 | ||
751 | return 0; | 750 | return 0; |
752 | } | 751 | } |
753 | #endif | ||
754 | 752 | ||
755 | static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume); | 753 | static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume); |
756 | 754 | ||