From: Fu Wei fu.wei@linaro.org
This patch adds a debug config option which can add "-DDEBUG" flag in the build for development reason.
Reasons: There are some drivers of Watchdog using pr_debug, dev_debug or some other similar function which depend on "DEBUG". Making a config option to enable those message is convenient for development.
Signed-off-by: Fu Wei fu.wei@linaro.org --- drivers/watchdog/Kconfig | 7 +++++++ drivers/watchdog/Makefile | 2 ++ 2 files changed, 9 insertions(+)
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 46d6f46..4bfb67d 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -36,6 +36,13 @@ config WATCHDOG_CORE and gives them the /dev/watchdog interface (and later also the sysfs interface).
+config WATCHDOG_DEBUG + bool "Debug support for WATCHDOG drivers" + depends on DEBUG_KERNEL + help + Say "yes" to enable debug messaging (like dev_dbg and pr_debug), + sysfs, and debugfs support in WatchDog controller and protocol drivers. + config WATCHDOG_NOWAYOUT bool "Disable watchdog shutdown on close" help diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 471f1b7c..854b81d 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile @@ -2,6 +2,8 @@ # Makefile for the WatchDog device drivers. #
+ccflags-$(CONFIG_WATCHDOG_DEBUG) := -DDEBUG + # The WatchDog Timer Driver Core. watchdog-objs += watchdog_core.o watchdog_dev.o obj-$(CONFIG_WATCHDOG_CORE) += watchdog.o