diff options
author | Yuanyuan Liu <yuanliu@codeaurora.org> | 2017-05-24 12:13:49 -0700 |
---|---|---|
committer | Yuanyuan Liu <yuanliu@codeaurora.org> | 2017-05-24 14:06:08 -0700 |
commit | 568d62f5653c85728add9671c52ab45373636e74 (patch) | |
tree | cb935ec3f7885a2a68349e337dbe962764464a6f /drivers/soc | |
parent | 8ac6a6b6683613f8dd1180b606d168789fb5b8e7 (diff) |
icnss: create debugfs entries when CONFIG_ICNSS_DEBUG is enabled
Other than stats every debugfs entry should be under
CONFIG_ICNSS_DEBUG so that we don't enable these on
build which doesn't have debugging support.
CRs-Fixed: 2051871
Change-Id: I336f449313bb1f0f8af4e82f40869f65f58d9f4e
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/qcom/icnss.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/soc/qcom/icnss.c b/drivers/soc/qcom/icnss.c index 9286d83bbc57..6a6009c051e8 100644 --- a/drivers/soc/qcom/icnss.c +++ b/drivers/soc/qcom/icnss.c @@ -4004,12 +4004,13 @@ static const struct file_operations icnss_regread_fops = { .llseek = seq_lseek, }; +#ifdef CONFIG_ICNSS_DEBUG static int icnss_debugfs_create(struct icnss_priv *priv) { int ret = 0; struct dentry *root_dentry; - root_dentry = debugfs_create_dir("icnss", 0); + root_dentry = debugfs_create_dir("icnss", NULL); if (IS_ERR(root_dentry)) { ret = PTR_ERR(root_dentry); @@ -4032,6 +4033,27 @@ static int icnss_debugfs_create(struct icnss_priv *priv) out: return ret; } +#else +static int icnss_debugfs_create(struct icnss_priv *priv) +{ + int ret = 0; + struct dentry *root_dentry; + + root_dentry = debugfs_create_dir("icnss", NULL); + + if (IS_ERR(root_dentry)) { + ret = PTR_ERR(root_dentry); + icnss_pr_err("Unable to create debugfs %d\n", ret); + return ret; + } + + priv->root_dentry = root_dentry; + + debugfs_create_file("stats", 0600, root_dentry, priv, + &icnss_stats_fops); + return 0; +} +#endif static void icnss_debugfs_destroy(struct icnss_priv *priv) { |