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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
---
 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


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux