ASoC: Intel: catpt: Switch to snd_snd_component_new()

snd_soc_component_alloc() leaves the component object in uninitialized
state. Switch to the constructor function to retrieve and operate on
object in sane state.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20261007133353.455185-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Cezary Rojewski 2026-10-07 15:33:51 +02:00 committed by Mark Brown
parent c0e1ffec60
commit 6cb74a0741
No known key found for this signature in database
GPG Key ID: 2FEF73B0B3D03889

View File

@ -1073,13 +1073,9 @@ int catpt_register_plat_component(struct catpt_dev *cdev)
{
struct snd_soc_component *component;
component = snd_soc_component_alloc(cdev->dev);
if (!component)
return -ENOMEM;
component = snd_soc_component_new(cdev->dev, catpt_comp_driver.name, &catpt_comp_driver);
if (IS_ERR(component))
return PTR_ERR(component);
snd_soc_component_set_name(component, catpt_comp_driver.name);
return snd_soc_register_component(component,
&catpt_comp_driver,
dai_drivers, ARRAY_SIZE(dai_drivers));
return snd_soc_component_register(component, dai_drivers, ARRAY_SIZE(dai_drivers));
}