summaryrefslogtreecommitdiff
path: root/sound/soc/stm
diff options
context:
space:
mode:
authorCezary Rojewski <cezary.rojewski@intel.com>2020-07-31 16:41:46 +0200
committerMark Brown <broonie@kernel.org>2020-07-31 19:35:59 +0100
commitea029dd8d0124fcd5db1c7003e87a7bd4ddb3bad (patch)
treee9c1030e49fe0ce0ee4b3a591c8ffb8f1ced2e19 /sound/soc/stm
parent7274d4cd8506bbff9bf2d7c2f73b2febff99abef (diff)
ASoC: core: Two step component registration
Modify snd_soc_add_component so it calls snd_soc_component_initialize no longer and thus providing true two-step registration. Drivers may choose to change component's fields before actually adding it to ASoC subsystem. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20200731144146.6678-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/stm')
-rw-r--r--sound/soc/stm/stm32_adfsdm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
index c1433c20b08b..ec27c13af04f 100644
--- a/sound/soc/stm/stm32_adfsdm.c
+++ b/sound/soc/stm/stm32_adfsdm.c
@@ -344,12 +344,17 @@ static int stm32_adfsdm_probe(struct platform_device *pdev)
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(&pdev->dev, component,
- &stm32_adfsdm_soc_platform, NULL, 0);
+ ret = snd_soc_add_component(component, NULL, 0);
if (ret < 0)
dev_err(&pdev->dev, "%s: Failed to register PCM platform\n",
__func__);