summaryrefslogtreecommitdiff
path: root/sound/soc/soc-link.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2020-07-20 10:17:39 +0900
committerMark Brown <broonie@kernel.org>2020-07-23 19:07:19 +0100
commit0ceef681e34a61afcd77af0837b2132925c5bad4 (patch)
tree97c8af1bd0a9a2df249a69fa17cb0ac5eea42ff3 /sound/soc/soc-link.c
parent0c5b270b2e6c92b6a752868a3a1abddc3c52186f (diff)
ASoC: soc-xxx: add asoc_substream_to_rtd()
Current soc-xxx are getting rtd from substream by rtd = substream->private_data; But, getting data from "private_data" is very unclear. This patch adds asoc_substream_to_rtd() macro which is easy to understand that rtd from substream. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87wo2z0yve.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-link.c')
-rw-r--r--sound/soc/soc-link.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/soc-link.c b/sound/soc/soc-link.c
index 1c3bf2118718..cec70b19863e 100644
--- a/sound/soc/soc-link.c
+++ b/sound/soc/soc-link.c
@@ -59,7 +59,7 @@ int snd_soc_link_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
int snd_soc_link_startup(struct snd_pcm_substream *substream)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
int ret = 0;
if (rtd->dai_link->ops &&
@@ -71,7 +71,7 @@ int snd_soc_link_startup(struct snd_pcm_substream *substream)
void snd_soc_link_shutdown(struct snd_pcm_substream *substream)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
if (rtd->dai_link->ops &&
rtd->dai_link->ops->shutdown)
@@ -80,7 +80,7 @@ void snd_soc_link_shutdown(struct snd_pcm_substream *substream)
int snd_soc_link_prepare(struct snd_pcm_substream *substream)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
int ret = 0;
if (rtd->dai_link->ops &&
@@ -93,7 +93,7 @@ int snd_soc_link_prepare(struct snd_pcm_substream *substream)
int snd_soc_link_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
int ret = 0;
if (rtd->dai_link->ops &&
@@ -105,7 +105,7 @@ int snd_soc_link_hw_params(struct snd_pcm_substream *substream,
void snd_soc_link_hw_free(struct snd_pcm_substream *substream)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
if (rtd->dai_link->ops &&
rtd->dai_link->ops->hw_free)
@@ -114,7 +114,7 @@ void snd_soc_link_hw_free(struct snd_pcm_substream *substream)
int snd_soc_link_trigger(struct snd_pcm_substream *substream, int cmd)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
int ret = 0;
if (rtd->dai_link->ops &&