ASoC: loongson: Use snd_soc_substream_to_rtd() for accessing private_data
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tue, 30 Apr 2024 14:02:18 +0000 (16:02 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 6 May 2024 14:59:53 +0000 (23:59 +0900)
Do not open-code snd_soc_substream_to_rtd().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240430-asoc-snd-substream-clean-v1-9-6f8a8902b479@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/loongson/loongson_card.c
sound/soc/loongson/loongson_dma.c

index e8432d466f60f95d30719a711046ca222f03ad51..fae5e9312bf08c9dd576023933856aff2ce97ab5 100644 (file)
@@ -23,7 +23,7 @@ struct loongson_card_data {
 static int loongson_card_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 = snd_soc_substream_to_rtd(substream);
        struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
        struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
        struct loongson_card_data *ls_card = snd_soc_card_get_drvdata(rtd->card);
index 8090662e8ff24d77c685d2c49984f0769f4962eb..4fcc2868160bb9bda7bf6a4d9c72666c2906d3c9 100644 (file)
@@ -226,7 +226,7 @@ static int loongson_pcm_open(struct snd_soc_component *component,
                             struct snd_pcm_substream *substream)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
        struct snd_card *card = substream->pcm->card;
        struct loongson_runtime_data *prtd;
        struct loongson_dma_data *dma_data;