Commit 7cf3c5b4 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-link: remove unneeded parameter from snd_soc_link_xxx()

"rtd" can be created from "substream".
Let's cleanup snd_soc_link_xxx().
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87y2pg3k78.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent a5e6c109
...@@ -9,18 +9,12 @@ ...@@ -9,18 +9,12 @@
#define __SOC_LINK_H #define __SOC_LINK_H
int snd_soc_link_init(struct snd_soc_pcm_runtime *rtd); int snd_soc_link_init(struct snd_soc_pcm_runtime *rtd);
int snd_soc_link_startup(struct snd_soc_pcm_runtime *rtd, int snd_soc_link_startup(struct snd_pcm_substream *substream);
struct snd_pcm_substream *substream); void snd_soc_link_shutdown(struct snd_pcm_substream *substream);
void snd_soc_link_shutdown(struct snd_soc_pcm_runtime *rtd, int snd_soc_link_prepare(struct snd_pcm_substream *substream);
struct snd_pcm_substream *substream); int snd_soc_link_hw_params(struct snd_pcm_substream *substream,
int snd_soc_link_prepare(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_substream *substream);
int snd_soc_link_hw_params(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params); struct snd_pcm_hw_params *params);
void snd_soc_link_hw_free(struct snd_soc_pcm_runtime *rtd, void snd_soc_link_hw_free(struct snd_pcm_substream *substream);
struct snd_pcm_substream *substream); int snd_soc_link_trigger(struct snd_pcm_substream *substream, int cmd);
int snd_soc_link_trigger(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_substream *substream, int cmd);
#endif /* __SOC_LINK_H */ #endif /* __SOC_LINK_H */
...@@ -36,9 +36,9 @@ int snd_soc_link_init(struct snd_soc_pcm_runtime *rtd) ...@@ -36,9 +36,9 @@ int snd_soc_link_init(struct snd_soc_pcm_runtime *rtd)
return soc_link_ret(rtd, ret); return soc_link_ret(rtd, ret);
} }
int snd_soc_link_startup(struct snd_soc_pcm_runtime *rtd, int snd_soc_link_startup(struct snd_pcm_substream *substream)
struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data;
int ret = 0; int ret = 0;
if (rtd->dai_link->ops && if (rtd->dai_link->ops &&
...@@ -48,17 +48,18 @@ int snd_soc_link_startup(struct snd_soc_pcm_runtime *rtd, ...@@ -48,17 +48,18 @@ int snd_soc_link_startup(struct snd_soc_pcm_runtime *rtd,
return soc_link_ret(rtd, ret); return soc_link_ret(rtd, ret);
} }
void snd_soc_link_shutdown(struct snd_soc_pcm_runtime *rtd, void snd_soc_link_shutdown(struct snd_pcm_substream *substream)
struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data;
if (rtd->dai_link->ops && if (rtd->dai_link->ops &&
rtd->dai_link->ops->shutdown) rtd->dai_link->ops->shutdown)
rtd->dai_link->ops->shutdown(substream); rtd->dai_link->ops->shutdown(substream);
} }
int snd_soc_link_prepare(struct snd_soc_pcm_runtime *rtd, int snd_soc_link_prepare(struct snd_pcm_substream *substream)
struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data;
int ret = 0; int ret = 0;
if (rtd->dai_link->ops && if (rtd->dai_link->ops &&
...@@ -68,10 +69,10 @@ int snd_soc_link_prepare(struct snd_soc_pcm_runtime *rtd, ...@@ -68,10 +69,10 @@ int snd_soc_link_prepare(struct snd_soc_pcm_runtime *rtd,
return soc_link_ret(rtd, ret); return soc_link_ret(rtd, ret);
} }
int snd_soc_link_hw_params(struct snd_soc_pcm_runtime *rtd, int snd_soc_link_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data;
int ret = 0; int ret = 0;
if (rtd->dai_link->ops && if (rtd->dai_link->ops &&
...@@ -81,17 +82,18 @@ int snd_soc_link_hw_params(struct snd_soc_pcm_runtime *rtd, ...@@ -81,17 +82,18 @@ int snd_soc_link_hw_params(struct snd_soc_pcm_runtime *rtd,
return soc_link_ret(rtd, ret); return soc_link_ret(rtd, ret);
} }
void snd_soc_link_hw_free(struct snd_soc_pcm_runtime *rtd, void snd_soc_link_hw_free(struct snd_pcm_substream *substream)
struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data;
if (rtd->dai_link->ops && if (rtd->dai_link->ops &&
rtd->dai_link->ops->hw_free) rtd->dai_link->ops->hw_free)
rtd->dai_link->ops->hw_free(substream); rtd->dai_link->ops->hw_free(substream);
} }
int snd_soc_link_trigger(struct snd_soc_pcm_runtime *rtd, int snd_soc_link_trigger(struct snd_pcm_substream *substream, int cmd)
struct snd_pcm_substream *substream, int cmd)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data;
int ret = 0; int ret = 0;
if (rtd->dai_link->ops && if (rtd->dai_link->ops &&
......
...@@ -683,7 +683,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream) ...@@ -683,7 +683,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
for_each_rtd_dais(rtd, i, dai) for_each_rtd_dais(rtd, i, dai)
snd_soc_dai_shutdown(dai, substream); snd_soc_dai_shutdown(dai, substream);
snd_soc_link_shutdown(rtd, substream); snd_soc_link_shutdown(substream);
soc_pcm_components_close(substream); soc_pcm_components_close(substream);
...@@ -730,7 +730,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) ...@@ -730,7 +730,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
if (ret < 0) if (ret < 0)
goto component_err; goto component_err;
ret = snd_soc_link_startup(rtd, substream); ret = snd_soc_link_startup(substream);
if (ret < 0) if (ret < 0)
goto rtd_startup_err; goto rtd_startup_err;
...@@ -814,7 +814,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) ...@@ -814,7 +814,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
for_each_rtd_dais(rtd, i, dai) for_each_rtd_dais(rtd, i, dai)
snd_soc_dai_shutdown(dai, substream); snd_soc_dai_shutdown(dai, substream);
snd_soc_link_shutdown(rtd, substream); snd_soc_link_shutdown(substream);
rtd_startup_err: rtd_startup_err:
soc_pcm_components_close(substream); soc_pcm_components_close(substream);
component_err: component_err:
...@@ -856,7 +856,7 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream) ...@@ -856,7 +856,7 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass); mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
ret = snd_soc_link_prepare(rtd, substream); ret = snd_soc_link_prepare(substream);
if (ret < 0) if (ret < 0)
goto out; goto out;
...@@ -943,7 +943,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -943,7 +943,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
if (ret) if (ret)
goto out; goto out;
ret = snd_soc_link_hw_params(rtd, substream, params); ret = snd_soc_link_hw_params(substream, params);
if (ret < 0) if (ret < 0)
goto out; goto out;
...@@ -1055,7 +1055,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -1055,7 +1055,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
codec_dai->rate = 0; codec_dai->rate = 0;
} }
snd_soc_link_hw_free(rtd, substream); snd_soc_link_hw_free(substream);
mutex_unlock(&rtd->card->pcm_mutex); mutex_unlock(&rtd->card->pcm_mutex);
return ret; return ret;
...@@ -1087,7 +1087,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream) ...@@ -1087,7 +1087,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
} }
/* free any machine hw params */ /* free any machine hw params */
snd_soc_link_hw_free(rtd, substream); snd_soc_link_hw_free(substream);
/* free any component resources */ /* free any component resources */
soc_pcm_components_hw_free(substream, NULL); soc_pcm_components_hw_free(substream, NULL);
...@@ -1110,7 +1110,7 @@ static int soc_pcm_trigger_start(struct snd_pcm_substream *substream, int cmd) ...@@ -1110,7 +1110,7 @@ static int soc_pcm_trigger_start(struct snd_pcm_substream *substream, int cmd)
struct snd_soc_component *component; struct snd_soc_component *component;
int i, ret; int i, ret;
ret = snd_soc_link_trigger(rtd, substream, cmd); ret = snd_soc_link_trigger(substream, cmd);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -1139,7 +1139,7 @@ static int soc_pcm_trigger_stop(struct snd_pcm_substream *substream, int cmd) ...@@ -1139,7 +1139,7 @@ static int soc_pcm_trigger_stop(struct snd_pcm_substream *substream, int cmd)
return ret; return ret;
} }
ret = snd_soc_link_trigger(rtd, substream, cmd); ret = snd_soc_link_trigger(substream, cmd);
if (ret < 0) if (ret < 0)
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