From: Cezary Rojewski <cezary.rojewski@intel.com>
To: broonie@kernel.org, linux-sound@vger.kernel.org
Cc: tiwai@suse.com, perex@perex.cz, amade@asmblr.net,
linux-kernel@vger.kernel.org, kuninori.morimoto.gx@renesas.com,
Cezary Rojewski <cezary.rojewski@intel.com>
Subject: [PATCH 2/7] ASoC: core: Rename and export soc_component_add()
Date: Wed, 7 Oct 2026 15:33:48 +0200 [thread overview]
Message-ID: <20261007133353.455185-3-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20261007133353.455185-1-cezary.rojewski@intel.com>
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>
---
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
next prev parent reply other threads:[~2026-10-07 13:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 13:33 [PATCH 0/7] ASoC: core: Create new components in sane state Cezary Rojewski
2026-10-07 13:33 ` [PATCH 1/7] ASoC: core: Add component constructor Cezary Rojewski
2026-10-07 13:33 ` Cezary Rojewski [this message]
2026-10-07 13:33 ` [PATCH 3/7] ASoC: dmaengine: Switch to snd_snd_component_new() Cezary Rojewski
2026-10-07 13:33 ` [PATCH 4/7] ASoC: topology-test: " Cezary Rojewski
2026-10-07 13:33 ` [PATCH 5/7] ASoC: Intel: catpt: " Cezary Rojewski
2026-10-07 13:33 ` [PATCH 6/7] ASoC: Intel: avs: " Cezary Rojewski
2026-10-07 13:33 ` [PATCH 7/7] ASoC: core: Remove unused component-register members Cezary Rojewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261007133353.455185-3-cezary.rojewski@intel.com \
--to=cezary.rojewski@intel.com \
--cc=amade@asmblr.net \
--cc=broonie@kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®