diff options
| author | Cezary Rojewski <cezary.rojewski@intel.com> | 2026-10-07 15:33:48 +0200 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-10-12 23:55:48 +0100 |
| commit | 4e2db62172b5e260550202f2cc6b97db6de98477 (patch) | |
| tree | 6dcfcdc3c0bc8d7e4a50ec41f8bd82d44148426f | |
| parent | 0f2bec6921f0971c2fc2f8bb5a93229b6546dded (diff) | |
| download | linux-4e2db62172b5e260550202f2cc6b97db6de98477.tar.gz linux-4e2db62172b5e260550202f2cc6b97db6de98477.zip | |
ASoC: core: Rename and export soc_component_add()
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@renesas.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20261007133353.455185-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | include/sound/soc-component.h | 3 | ||||
| -rw-r--r-- | 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 @@ err_cleanup: 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); |
