mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
ASoC: dmaengine: 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. Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20261007133353.455185-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
4e2db62172
commit
857469990e
|
|
@ -454,10 +454,6 @@ int snd_dmaengine_pcm_register(struct device *dev,
|
|||
struct dmaengine_pcm *pcm;
|
||||
int ret;
|
||||
|
||||
component = snd_soc_component_alloc(dev);
|
||||
if (!component)
|
||||
return -ENOMEM;
|
||||
|
||||
pcm = kzalloc_obj(*pcm);
|
||||
if (!pcm)
|
||||
return -ENOMEM;
|
||||
|
|
@ -467,10 +463,6 @@ int snd_dmaengine_pcm_register(struct device *dev,
|
|||
pcm->config = config;
|
||||
pcm->flags = flags;
|
||||
|
||||
if (config->name)
|
||||
snd_soc_component_set_name(component, config->name);
|
||||
snd_soc_component_set_priv(component, pcm);
|
||||
|
||||
ret = dmaengine_pcm_request_chan_of(pcm, dev, config);
|
||||
if (ret)
|
||||
goto err_free_dma;
|
||||
|
|
@ -480,7 +472,15 @@ int snd_dmaengine_pcm_register(struct device *dev,
|
|||
else
|
||||
driver = &dmaengine_pcm_component;
|
||||
|
||||
ret = snd_soc_register_component(component, driver, NULL, 0);
|
||||
component = snd_soc_component_new(dev, config->name, driver);
|
||||
if (IS_ERR(component)) {
|
||||
ret = PTR_ERR(component);
|
||||
goto err_free_dma;
|
||||
}
|
||||
|
||||
snd_soc_component_set_priv(component, pcm);
|
||||
|
||||
ret = snd_soc_component_register(component, NULL, 0);
|
||||
if (ret)
|
||||
goto err_free_dma;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user