Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 568d62f5 authored by Yuanyuan Liu's avatar Yuanyuan Liu
Browse files

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: default avatarYuanyuan Liu <yuanliu@codeaurora.org>
parent 8ac6a6b6
Loading
Loading
Loading
Loading
+23 −1
Original line number Diff line number Diff line
@@ -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)
{