Skip to content

Commit 3beb985

Browse files
krzkbroonie
authored andcommitted
ASoC: tegra: Use snd_soc_substream_to_rtd() for accessing private_data
Do not open-code snd_soc_substream_to_rtd(). Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 77678a2 commit 3beb985

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sound/soc/tegra/tegra_asoc_machine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static unsigned int tegra_machine_mclk_rate_6mhz(unsigned int srate)
290290
static int tegra_machine_hw_params(struct snd_pcm_substream *substream,
291291
struct snd_pcm_hw_params *params)
292292
{
293-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
293+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
294294
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
295295
struct snd_soc_card *card = rtd->card;
296296
struct tegra_machine *machine = snd_soc_card_get_drvdata(card);

sound/soc/tegra/tegra_pcm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ EXPORT_SYMBOL_GPL(tegra_pcm_platform_unregister);
7676
int tegra_pcm_open(struct snd_soc_component *component,
7777
struct snd_pcm_substream *substream)
7878
{
79-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
79+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
8080
struct snd_dmaengine_dai_dma_data *dmap;
8181
struct dma_chan *chan;
8282
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
@@ -127,7 +127,7 @@ EXPORT_SYMBOL_GPL(tegra_pcm_open);
127127
int tegra_pcm_close(struct snd_soc_component *component,
128128
struct snd_pcm_substream *substream)
129129
{
130-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
130+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
131131

132132
if (rtd->dai_link->no_pcm)
133133
return 0;
@@ -142,7 +142,7 @@ int tegra_pcm_hw_params(struct snd_soc_component *component,
142142
struct snd_pcm_substream *substream,
143143
struct snd_pcm_hw_params *params)
144144
{
145-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
145+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
146146
struct snd_dmaengine_dai_dma_data *dmap;
147147
struct dma_slave_config slave_config;
148148
struct dma_chan *chan;

0 commit comments

Comments
 (0)