mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
ASoC: Intel: avs: Drop pcm.h dependency for probes
The 'probe' machine board is not a typical one, it serves debug purpose only and does not expect any kind of topology. The topology descriptor pointer (acomp->tplg) is the only reason an avs-driver component would utilize the pcm.c helpers and be described by a 'struct avs_soc_component' instance rather than 'struct snd_soc_component' one. Cut the line linking probes.c with pcm.h to avoid confusing readers. And with that link gone, constify the component-driver again. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20250818104126.526442-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
62dc545be1
commit
df36e5c197
|
|
@ -285,7 +285,7 @@ static struct snd_soc_dai_driver probe_cpu_dais[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct snd_soc_component_driver avs_probe_component_driver = {
|
||||
static const struct snd_soc_component_driver avs_probe_component_driver = {
|
||||
.name = "avs-probe-compr",
|
||||
.compress_ops = &avs_probe_compress_ops,
|
||||
.module_get_upon_open = 1, /* increment refcount when a stream is opened */
|
||||
|
|
@ -293,6 +293,20 @@ static struct snd_soc_component_driver avs_probe_component_driver = {
|
|||
|
||||
int avs_probe_platform_register(struct avs_dev *adev, const char *name)
|
||||
{
|
||||
return avs_soc_component_register(adev->dev, name, &avs_probe_component_driver,
|
||||
probe_cpu_dais, ARRAY_SIZE(probe_cpu_dais));
|
||||
struct snd_soc_component *component;
|
||||
int ret;
|
||||
|
||||
component = devm_kzalloc(adev->dev, sizeof(*component), GFP_KERNEL);
|
||||
if (!component)
|
||||
return -ENOMEM;
|
||||
|
||||
component->name = devm_kstrdup(adev->dev, name, GFP_KERNEL);
|
||||
if (!component->name)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = snd_soc_component_initialize(component, &avs_probe_component_driver, adev->dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return snd_soc_add_component(component, probe_cpu_dais, ARRAY_SIZE(probe_cpu_dais));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user