summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorLars-Peter Clausen2015-04-09 10:52:38 +0200
committerMark Brown2015-04-09 13:23:14 +0200
commit6553bf06a369683408895b87e5172aa99a9266bd (patch)
tree39ddb89fa018f224eb46b67894f0ff13ae986ac5 /sound/soc/soc-dapm.c
parentASoC: Make soc_dpcm_debugfs_add() non-fatal (diff)
downloadkernel-qcow2-linux-6553bf06a369683408895b87e5172aa99a9266bd.tar.gz
kernel-qcow2-linux-6553bf06a369683408895b87e5172aa99a9266bd.tar.xz
kernel-qcow2-linux-6553bf06a369683408895b87e5172aa99a9266bd.zip
ASoC: Don't try to register debugfs entries if the parent does not exist
If the registration of a debugfs directory fails this is treated as a non-fatal error in ASoC and operation continues as normal. This means we need to be careful and check if the parent debugfs directory exists if we try to register a debugfs file or sub-directory. Otherwise we might end up passing NULL for the parent and the file or directory will be registered in the top-level debugfs directory. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index b6f88202b8c9..1fd2d458824e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1898,6 +1898,9 @@ void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
{
struct dentry *d;
+ if (!parent)
+ return;
+
dapm->debugfs_dapm = debugfs_create_dir("dapm", parent);
if (!dapm->debugfs_dapm) {