| From 36115074d0ca9886383cf2d948a17fd685bd1806 Mon Sep 17 00:00:00 2001 |
| From: Arnd Bergmann <arnd@arndb.de> |
| Date: Wed, 19 Apr 2017 19:52:43 +0200 |
| Subject: [PATCH 125/286] 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> |
| (cherry picked from commit 5d05e81516cfe7606ee0cd8278fe225314dccfbe) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| drivers/rtc/rtc-sh.c | 6 ++---- |
| 1 file changed, 2 insertions(+), 4 deletions(-) |
| |
| --- a/drivers/rtc/rtc-sh.c |
| +++ b/drivers/rtc/rtc-sh.c |
| @@ -734,8 +734,7 @@ static void sh_rtc_set_irq_wake(struct d |
| } |
| } |
| |
| -#ifdef CONFIG_PM_SLEEP |
| -static int sh_rtc_suspend(struct device *dev) |
| +static int __maybe_unused sh_rtc_suspend(struct device *dev) |
| { |
| if (device_may_wakeup(dev)) |
| sh_rtc_set_irq_wake(dev, 1); |
| @@ -743,14 +742,13 @@ static int sh_rtc_suspend(struct device |
| 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)) |
| sh_rtc_set_irq_wake(dev, 0); |
| |
| return 0; |
| } |
| -#endif |
| |
| static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume); |
| |