aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2026-06-02 02:55:51 +0000
committerMark Brown <broonie@kernel.org>2026-06-10 12:21:13 +0100
commitd7c18d15c6d93ffcaaaa0c68c31122293c9d1dde (patch)
treed481464235a5296aebe1ab0bda3bfbeb82cbcede /sound
parent921ee966824b971675927b343394cd1096754487 (diff)
downloadath-d7c18d15c6d93ffcaaaa0c68c31122293c9d1dde.tar.gz
ASoC: stm: stm32_adfsdm: set debugfs_prefix via Component driver
We can set component->debugfs_prefix via component_driver->debugfs_prefix. Use it. Now it no longer need to use snd_soc_component_initialize() / snd_soc_component_add(). Use snd_soc_component_register() instead. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87fr35k5vs.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/stm/stm32_adfsdm.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
index a585cb9fc011a..66efb9a0acb9e 100644
--- a/sound/soc/stm/stm32_adfsdm.c
+++ b/sound/soc/stm/stm32_adfsdm.c
@@ -312,6 +312,7 @@ static const struct snd_soc_component_driver stm32_adfsdm_soc_platform = {
.trigger = stm32_adfsdm_trigger,
.pointer = stm32_adfsdm_pcm_pointer,
.pcm_new = stm32_adfsdm_pcm_new,
+ .debugfs_prefix = "pcm",
};
static const struct of_device_id stm32_adfsdm_of_match[] = {
@@ -323,7 +324,6 @@ MODULE_DEVICE_TABLE(of, stm32_adfsdm_of_match);
static int stm32_adfsdm_probe(struct platform_device *pdev)
{
struct stm32_adfsdm_priv *priv;
- struct snd_soc_component *component;
int ret;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
@@ -357,20 +357,9 @@ static int stm32_adfsdm_probe(struct platform_device *pdev)
return ret;
}
- component = devm_kzalloc(&pdev->dev, sizeof(*component), GFP_KERNEL);
- if (!component)
- return -ENOMEM;
-
- ret = snd_soc_component_initialize(component,
- &stm32_adfsdm_soc_platform,
- &pdev->dev);
- if (ret < 0)
- return ret;
-#ifdef CONFIG_DEBUG_FS
- component->debugfs_prefix = "pcm";
-#endif
-
- ret = snd_soc_add_component(component, NULL, 0);
+ ret = devm_snd_soc_register_component(&pdev->dev,
+ &stm32_adfsdm_soc_platform,
+ NULL, 0);
if (ret < 0) {
dev_err(&pdev->dev, "%s: Failed to register PCM platform\n",
__func__);