[PATCH 5/6] watchdog: add static inline no-ops if WD is disabled

Marc Kleine-Budde mkl at pengutronix.de
Wed May 6 05:51:30 PDT 2015


Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
---
 include/watchdog.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/watchdog.h b/include/watchdog.h
index 3e2d08e87645..7e37b7c22a8d 100644
--- a/include/watchdog.h
+++ b/include/watchdog.h
@@ -17,8 +17,25 @@ struct watchdog {
 	int (*set_timeout)(struct watchdog *, unsigned);
 };
 
+#ifdef CONFIG_WATCHDOG
 int watchdog_register(struct watchdog *);
 int watchdog_deregister(struct watchdog *);
 int watchdog_set_timeout(unsigned);
+#else
+static inline int watchdog_register(struct watchdog *w)
+{
+	return 0;
+}
+
+int watchdog_deregister(struct watchdog *w)
+{
+	return 0;
+}
+
+int watchdog_set_timeout(unsigned t)
+{
+	return 0;
+}
+#endif
 
 #endif /* INCLUDE_WATCHDOG_H */
-- 
2.1.4




More information about the barebox mailing list