diff mbox

[2/3] ASoC: Make soc_dpcm_debugfs_add() non-fatal

Message ID 1428569558-15883-2-git-send-email-lars@metafoo.de (mailing list archive)
State Accepted
Commit 2e55b90a5e234524f8195c657006ec4f71103dff
Headers show

Commit Message

Lars-Peter Clausen April 9, 2015, 8:52 a.m. UTC
Failing to register the debugfs entries is not fatal and will not affect
normal operation of the sound card. Don't abort the card registration if
soc_dpcm_debugfs_add() fails.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 include/sound/soc-dpcm.h |  2 +-
 sound/soc/soc-core.c     | 11 ++---------
 sound/soc/soc-pcm.c      |  8 +++-----
 3 files changed, 6 insertions(+), 15 deletions(-)

Comments

Mark Brown April 9, 2015, 10:44 a.m. UTC | #1
On Thu, Apr 09, 2015 at 10:52:37AM +0200, Lars-Peter Clausen wrote:
> Failing to register the debugfs entries is not fatal and will not affect
> normal operation of the sound card. Don't abort the card registration if
> soc_dpcm_debugfs_add() fails.

Applied, thanks.
diff mbox

Patch

diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h
index 98f2ade..8060590 100644
--- a/include/sound/soc-dpcm.h
+++ b/include/sound/soc-dpcm.h
@@ -135,7 +135,7 @@  void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, int stream,
 
 /* internal use only */
 int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute);
-int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd);
+void soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd);
 int soc_dpcm_runtime_update(struct snd_soc_card *);
 
 int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 7bd1599..e97b395 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1324,15 +1324,8 @@  static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
 
 #ifdef CONFIG_DEBUG_FS
 	/* add DPCM sysfs entries */
-	if (dai_link->dynamic) {
-		ret = soc_dpcm_debugfs_add(rtd);
-		if (ret < 0) {
-			dev_err(rtd->dev,
-				"ASoC: failed to add dpcm sysfs entries: %d\n",
-				ret);
-			return ret;
-		}
-	}
+	if (dai_link->dynamic)
+		soc_dpcm_debugfs_add(rtd);
 #endif
 
 	if (cpu_dai->driver->compress_dai) {
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 6e3781e..e67378a 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2803,10 +2803,10 @@  static const struct file_operations dpcm_state_fops = {
 	.llseek = default_llseek,
 };
 
-int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd)
+void soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd)
 {
 	if (!rtd->dai_link)
-		return 0;
+		return;
 
 	rtd->debugfs_dpcm_root = debugfs_create_dir(rtd->dai_link->name,
 			rtd->card->debugfs_card_root);
@@ -2814,13 +2814,11 @@  int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd)
 		dev_dbg(rtd->dev,
 			 "ASoC: Failed to create dpcm debugfs directory %s\n",
 			 rtd->dai_link->name);
-		return -EINVAL;
+		return;
 	}
 
 	rtd->debugfs_dpcm_state = debugfs_create_file("state", 0444,
 						rtd->debugfs_dpcm_root,
 						rtd, &dpcm_state_fops);
-
-	return 0;
 }
 #endif