Commit b2b2afbb authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-component: tidyup snd_soc_pcm_component_new/free() parameter

This patch uses rtd instead of pcm at snd_soc_pcm_component_new/free()
parameter.
This is prepare for dai_link remove bug fix on topology.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pnhqx89j.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent eb65ccdb
...@@ -412,7 +412,7 @@ struct page *snd_soc_pcm_component_page(struct snd_pcm_substream *substream, ...@@ -412,7 +412,7 @@ struct page *snd_soc_pcm_component_page(struct snd_pcm_substream *substream,
unsigned long offset); unsigned long offset);
int snd_soc_pcm_component_mmap(struct snd_pcm_substream *substream, int snd_soc_pcm_component_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma); struct vm_area_struct *vma);
int snd_soc_pcm_component_new(struct snd_pcm *pcm); int snd_soc_pcm_component_new(struct snd_soc_pcm_runtime *rtd);
void snd_soc_pcm_component_free(struct snd_pcm *pcm); void snd_soc_pcm_component_free(struct snd_soc_pcm_runtime *rtd);
#endif /* __SOC_COMPONENT_H */ #endif /* __SOC_COMPONENT_H */
...@@ -498,9 +498,8 @@ int snd_soc_pcm_component_mmap(struct snd_pcm_substream *substream, ...@@ -498,9 +498,8 @@ int snd_soc_pcm_component_mmap(struct snd_pcm_substream *substream,
return -EINVAL; return -EINVAL;
} }
int snd_soc_pcm_component_new(struct snd_pcm *pcm) int snd_soc_pcm_component_new(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_pcm_runtime *rtd = pcm->private_data;
struct snd_soc_rtdcom_list *rtdcom; struct snd_soc_rtdcom_list *rtdcom;
struct snd_soc_component *component; struct snd_soc_component *component;
int ret; int ret;
...@@ -516,13 +515,12 @@ int snd_soc_pcm_component_new(struct snd_pcm *pcm) ...@@ -516,13 +515,12 @@ int snd_soc_pcm_component_new(struct snd_pcm *pcm)
return 0; return 0;
} }
void snd_soc_pcm_component_free(struct snd_pcm *pcm) void snd_soc_pcm_component_free(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_pcm_runtime *rtd = pcm->private_data;
struct snd_soc_rtdcom_list *rtdcom; struct snd_soc_rtdcom_list *rtdcom;
struct snd_soc_component *component; struct snd_soc_component *component;
for_each_rtd_components(rtd, rtdcom, component) for_each_rtd_components(rtd, rtdcom, component)
if (component->driver->pcm_destruct) if (component->driver->pcm_destruct)
component->driver->pcm_destruct(component, pcm); component->driver->pcm_destruct(component, rtd->pcm);
} }
...@@ -2898,7 +2898,7 @@ static void soc_pcm_private_free(struct snd_pcm *pcm) ...@@ -2898,7 +2898,7 @@ static void soc_pcm_private_free(struct snd_pcm *pcm)
/* need to sync the delayed work before releasing resources */ /* need to sync the delayed work before releasing resources */
flush_delayed_work(&rtd->delayed_work); flush_delayed_work(&rtd->delayed_work);
snd_soc_pcm_component_free(pcm); snd_soc_pcm_component_free(rtd);
} }
/* create a new pcm */ /* create a new pcm */
...@@ -3036,7 +3036,7 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) ...@@ -3036,7 +3036,7 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
if (capture) if (capture)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &rtd->ops); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &rtd->ops);
ret = snd_soc_pcm_component_new(pcm); ret = snd_soc_pcm_component_new(rtd);
if (ret < 0) { if (ret < 0) {
dev_err(rtd->dev, "ASoC: pcm constructor failed: %d\n", ret); dev_err(rtd->dev, "ASoC: pcm constructor failed: %d\n", ret);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment