diff mbox

[v3,1/2] ASoC: soc-core: Remove unneeded dentry member from snd_soc_codec

Message ID 1502107733-29628-1-git-send-email-festevam@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Fabio Estevam Aug. 7, 2017, 12:08 p.m. UTC
There is no need to have the *debugfs_reg dentry member as part of
the snd_soc_codec structure as its only usage is inside
soc_init_codec_debugfs().

Use a local dentry variable instead.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v2:
- None

 include/sound/soc.h  | 4 ----
 sound/soc/soc-core.c | 9 +++++----
 2 files changed, 5 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 9d6e1db..42e2e50 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -897,10 +897,6 @@  struct snd_soc_codec {
 
 	/* component */
 	struct snd_soc_component component;
-
-#ifdef CONFIG_DEBUG_FS
-	struct dentry *debugfs_reg;
-#endif
 };
 
 /* codec driver */
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 13c875e..e93a72c 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -339,11 +339,12 @@  static void soc_cleanup_component_debugfs(struct snd_soc_component *component)
 static void soc_init_codec_debugfs(struct snd_soc_component *component)
 {
 	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
+	struct dentry *debugfs_reg;
 
-	codec->debugfs_reg = debugfs_create_file("codec_reg", 0644,
-						 codec->component.debugfs_root,
-						 codec, &codec_reg_fops);
-	if (!codec->debugfs_reg)
+	debugfs_reg = debugfs_create_file("codec_reg", 0644,
+					  codec->component.debugfs_root,
+					  codec, &codec_reg_fops);
+	if (!debugfs_reg)
 		dev_warn(codec->dev,
 			"ASoC: Failed to create codec register debugfs file\n");
 }