ASoC: tegra: Use snd_soc_substream_to_rtd() for accessing private_data
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tue, 30 Apr 2024 14:02:11 +0000 (16:02 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 6 May 2024 14:59:47 +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-2-6f8a8902b479@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/tegra/tegra_asoc_machine.c
sound/soc/tegra/tegra_pcm.c

index 192e9692bdf2edac3c7a5540ce6a7699a8296925..775ce433fdbfdbcff4d09d078dbb0e65c0b15b60 100644 (file)
@@ -290,7 +290,7 @@ static unsigned int tegra_machine_mclk_rate_6mhz(unsigned int srate)
 static int tegra_machine_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 *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
        struct snd_soc_card *card = rtd->card;
        struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
index 42acb56543db66763f6445907bf7094aba3354d9..4bdbcd2635ef5c510c4f1561f8396c701f2e893f 100644 (file)
@@ -76,7 +76,7 @@ EXPORT_SYMBOL_GPL(tegra_pcm_platform_unregister);
 int tegra_pcm_open(struct snd_soc_component *component,
                   struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
        struct snd_dmaengine_dai_dma_data *dmap;
        struct dma_chan *chan;
        struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
@@ -127,7 +127,7 @@ EXPORT_SYMBOL_GPL(tegra_pcm_open);
 int tegra_pcm_close(struct snd_soc_component *component,
                    struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
 
        if (rtd->dai_link->no_pcm)
                return 0;
@@ -142,7 +142,7 @@ int tegra_pcm_hw_params(struct snd_soc_component *component,
                        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_dmaengine_dai_dma_data *dmap;
        struct dma_slave_config slave_config;
        struct dma_chan *chan;