[PATCH 1/5] Add CONFIG_WCN36XX_DEBUGFS
Eugene Krasnikov
k.eugene.e at gmail.com
Thu Aug 1 07:18:06 EDT 2013
Configure debugfs support through Kconfig.
Signed-off-by: Eugene Krasnikov <k.eugene.e at gmail.com>
---
Kconfig | 8 ++++++++
debug.c | 2 ++
debug.h | 11 +++++++++++
wcn36xx.h | 3 +++
4 files changed, 24 insertions(+)
diff --git a/Kconfig b/Kconfig
index 4d4909e..59fe1f3 100644
--- a/Kconfig
+++ b/Kconfig
@@ -6,3 +6,11 @@ config WCN36XX
Qualcomm Atheros WCN3660 and WCN3680 mobile chipsets.
If you choose to build a module, it'll be called wcn36xx.
+
+config WCN36XX_DEBUGFS
+ bool "WCN36XX debugfs support"
+ depends on WCN36XX
+ ---help---
+ Enabled debugfs support
+
+ If unsure, say Y to make it easier to debug problems.
diff --git a/debug.c b/debug.c
index 529dd54..9adc475 100644
--- a/debug.c
+++ b/debug.c
@@ -25,6 +25,7 @@
#include "debug.h"
#include "pmc.h"
+#ifdef CONFIG_WCN36XX_DEBUGFS
static int wcn36xx_debugfs_open(struct inode *inode, struct file *file)
{
file->private_data = inode->i_private;
@@ -194,3 +195,4 @@ void wcn36xx_debugfs_exit(struct wcn36xx *wcn)
struct wcn36xx_dfs_entry *dfs = &wcn->dfs;
debugfs_remove_recursive(dfs->rootdir);
}
+#endif /* CONFIG_WCN36XX_DEBUGFS */
diff --git a/debug.h b/debug.h
index 3a3cf5f..e8d5de3 100644
--- a/debug.h
+++ b/debug.h
@@ -26,6 +26,7 @@
#define WCN36xx_MAX_DUMP_ARGS 5
+#ifdef CONFIG_WCN36XX_DEBUGFS
struct wcn36xx_dfs_file {
struct dentry *dentry;
u32 value;
@@ -41,4 +42,14 @@ struct wcn36xx_dfs_entry {
void wcn36xx_debugfs_init(struct wcn36xx *wcn);
void wcn36xx_debugfs_exit(struct wcn36xx *wcn);
+#else
+static inline void wcn36xx_debugfs_init(struct wcn36xx *wcn)
+{
+}
+static inline void wcn36xx_debugfs_exit(struct wcn36xx *wcn)
+{
+}
+
+#endif /* CONFIG_WCN36XX_DEBUGFS */
+
#endif /* _WCN36XX_DEBUG_H_ */
diff --git a/wcn36xx.h b/wcn36xx.h
index 88a0b02..03895b2 100644
--- a/wcn36xx.h
+++ b/wcn36xx.h
@@ -213,8 +213,11 @@ struct wcn36xx {
/* Power management */
enum wcn36xx_power_state pw_state;
+#ifdef CONFIG_WCN36XX_DEBUGFS
/* Debug file system entry */
struct wcn36xx_dfs_entry dfs;
+#endif /* CONFIG_WCN36XX_DEBUGFS */
+
};
#endif /* _WCN36XX_H_ */
--
1.8.2.2
More information about the wcn36xx
mailing list