summaryrefslogtreecommitdiff
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2022-03-09 21:21:55 +0100
committerMark Brown <broonie@kernel.org>2022-04-05 19:14:20 +0100
commitd462f6ed2aeac30c0b440a91fb05d964956935f9 (patch)
treebf99207946ff53ab3b5c1f313b16c10f7863dbb1 /sound/soc/soc-core.c
parent0b3d5d2e358ca6772fc3662fca27acb12a682fbf (diff)
downloadlwn-d462f6ed2aeac30c0b440a91fb05d964956935f9.tar.gz
lwn-d462f6ed2aeac30c0b440a91fb05d964956935f9.zip
ASoC: soc-core: add debugfs_prefix member to snd_soc_component_driver
Allow the component debugfs_prefix to be set from snd_soc_component_driver. First use case is avoiding a duplicate debugfs entry error in case a device has multiple components which have the same name therefore. Note that we don't set component->debugfs_prefix if it's set already. That's needed because partially component->debugfs_prefix is set before calling snd_soc_component_initialize(). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/d18bff6a-1df1-5f95-0cf8-10dbaa62d7be@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index ce153ac2c3ab..8c7da82a62ca 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2587,6 +2587,11 @@ int snd_soc_component_initialize(struct snd_soc_component *component,
component->dev = dev;
component->driver = driver;
+#ifdef CONFIG_DEBUG_FS
+ if (!component->debugfs_prefix)
+ component->debugfs_prefix = driver->debugfs_prefix;
+#endif
+
return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_component_initialize);