summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorGuenter Roeck <groeck@chromium.org>2016-03-04 07:22:27 -0800
committerGuenter Roeck <groeck@chromium.org>2016-03-04 09:19:29 -0800
commitc2c4c4ecd27d69807906cf6f0df5a176e1498e71 (patch)
treefc0925ba8e5510c7b8d3828998bdc549eea10346 /include/linux
parent6b7afd3c5e1af8db9e933bf9a7438e3d3a5035f5 (diff)
power: Provide dummy log_suspend_abort_reason() if SUSPEND is disabled
The API to log the suspend reason was introduced with commit 57caa2ad5ce3 ("power: Adds functionality to log the last suspend abort reason."). It is called from functions enabled with PM_SLEEP and from functions enabled with SUSPEND, but only available if SUSPEND is enabled. This can result in build failures such as the following if PM_SLEEP is enabled, but SUSPEND is not. kernel/built-in.o: In function `try_to_freeze_tasks': process.c:(.text+0x30928): undefined reference to `log_suspend_abort_reason' drivers/built-in.o: In function `syscore_suspend': (.text+0x6e250): undefined reference to `log_suspend_abort_reason' drivers/built-in.o: In function `__device_suspend': main.c:(.text+0x7a528): undefined reference to `log_suspend_abort_reason' Fixes: 57caa2ad5ce3 ("power: Adds functionality to log the last suspend abort reason.") Signed-off-by: Guenter Roeck <groeck@chromium.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/wakeup_reason.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/wakeup_reason.h b/include/linux/wakeup_reason.h
index ad8b76936c7f..d84d8c301546 100644
--- a/include/linux/wakeup_reason.h
+++ b/include/linux/wakeup_reason.h
@@ -21,7 +21,12 @@
#define MAX_SUSPEND_ABORT_LEN 256
void log_wakeup_reason(int irq);
-void log_suspend_abort_reason(const char *fmt, ...);
int check_wakeup_reason(int irq);
+#ifdef CONFIG_SUSPEND
+void log_suspend_abort_reason(const char *fmt, ...);
+#else
+static inline void log_suspend_abort_reason(const char *fmt, ...) { }
+#endif
+
#endif /* _LINUX_WAKEUP_REASON_H */