summaryrefslogtreecommitdiffstats
path: root/include/watchdog.h
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2015-05-06 14:51:30 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-05-15 07:01:42 +0200
commit55c8ed306f5266288667b55d74cf9e355435a1a2 (patch)
tree98b70ddc1f4461726c813ea79efb05844d2a7835 /include/watchdog.h
parent677828663999214a63a7fb685db8bd1630d818da (diff)
downloadbarebox-55c8ed306f5266288667b55d74cf9e355435a1a2.tar.gz
barebox-55c8ed306f5266288667b55d74cf9e355435a1a2.tar.xz
watchdog: add static inline no-ops if WD is disabled
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/watchdog.h')
-rw-r--r--include/watchdog.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/watchdog.h b/include/watchdog.h
index 3e2d08e876..7e37b7c22a 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 */