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

Commit 2e55b90a authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown
Browse files

ASoC: Make soc_dpcm_debugfs_add() non-fatal



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: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0757d834
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,
+2 −9
Original line number Diff line number Diff line
@@ -1328,15 +1328,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) {
+3 −5
Original line number Diff line number Diff line
@@ -2802,10 +2802,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);
@@ -2813,13 +2813,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