[PATCH 2/7] ASoC: core: Rename and export soc_component_add()
From: Cezary Rojewski
Date: Wed Oct 07 2026 - 09:36:05 EST
To keep the register/unregister pattern intact, rename to the function
before exporting it. This concludes the registration update, leaving the
following two options available to the callers:
1) snd_soc_component_register(component..)
2) snd_soc_register_component(dev..)
A driver uses 1) when attempting to register a pre-constructed
component object explicitly and 2) when they want the ASoC framework to
do the entire job for them.
Cc: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
Signed-off-by: Cezary Rojewski <cezary.rojewski@xxxxxxxxx>
---
include/sound/soc-component.h | 3 +++
sound/soc/soc-core.c | 11 ++++++-----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index d51f71e2f334..f4d4f836269e 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -294,6 +294,9 @@ static inline int snd_soc_component_cache_sync(
struct snd_soc_component *snd_soc_component_new(struct device *dev, const char *name,
const struct snd_soc_component_driver *driver);
+int snd_soc_component_register(struct snd_soc_component *component,
+ struct snd_soc_dai_driver *dai_drv,
+ int num_dai);
struct snd_soc_component *snd_soc_component_alloc(struct device *dev);
void snd_soc_component_set_name(struct snd_soc_component *component, const char *name);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c4de336ab408..93bc7fa32444 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2625,9 +2625,9 @@ struct snd_soc_component *snd_soc_component_new(struct device *dev, const char *
}
EXPORT_SYMBOL_GPL(snd_soc_component_new);
-static int soc_component_add(struct snd_soc_component *component,
- struct snd_soc_dai_driver *dai_drv,
- int num_dai)
+int snd_soc_component_register(struct snd_soc_component *component,
+ struct snd_soc_dai_driver *dai_drv,
+ int num_dai)
{
struct snd_soc_card *card, *c;
int ret;
@@ -2666,6 +2666,7 @@ static int soc_component_add(struct snd_soc_component *component,
return ret;
}
+EXPORT_SYMBOL_GPL(snd_soc_component_register);
int snd_soc_register_component_c(struct snd_soc_component *component,
const struct snd_soc_component_driver *component_driver,
@@ -2678,7 +2679,7 @@ int snd_soc_register_component_c(struct snd_soc_component *component,
if (ret < 0)
return ret;
- return soc_component_add(component, dai_drv, num_dai);
+ return snd_soc_component_register(component, dai_drv, num_dai);
}
EXPORT_SYMBOL_GPL(snd_soc_register_component_c);
@@ -2693,7 +2694,7 @@ int snd_soc_register_component_d(struct device *dev,
if (IS_ERR(component))
return PTR_ERR(component);
- return soc_component_add(component, dai_drv, num_dai);
+ return snd_soc_component_register(component, dai_drv, num_dai);
}
EXPORT_SYMBOL_GPL(snd_soc_register_component_d);
--
2.34.1