Skip to content

Commit b695d8b

Browse files
krzkbroonie
authored andcommitted
ASoC: fsl: 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 a84d840 commit b695d8b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

sound/soc/fsl/fsl-asoc-card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream,
242242

243243
static int fsl_asoc_card_hw_free(struct snd_pcm_substream *substream)
244244
{
245-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
245+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
246246
struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card);
247247
struct codec_priv *codec_priv = &priv->codec_priv;
248248
struct device *dev = rtd->card->dev;

sound/soc/fsl/imx-card.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static unsigned long akcodec_get_mclk_rate(struct snd_pcm_substream *substream,
252252
struct snd_pcm_hw_params *params,
253253
int slots, int slot_width)
254254
{
255-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
255+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
256256
struct imx_card_data *data = snd_soc_card_get_drvdata(rtd->card);
257257
const struct imx_card_plat_data *plat_data = data->plat_data;
258258
struct dai_link_data *link_data = &data->link_data[rtd->num];
@@ -289,7 +289,7 @@ static unsigned long akcodec_get_mclk_rate(struct snd_pcm_substream *substream,
289289
static int imx_aif_hw_params(struct snd_pcm_substream *substream,
290290
struct snd_pcm_hw_params *params)
291291
{
292-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
292+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
293293
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
294294
struct snd_soc_card *card = rtd->card;
295295
struct imx_card_data *data = snd_soc_card_get_drvdata(card);
@@ -405,7 +405,7 @@ static int ak5558_hw_rule_rate(struct snd_pcm_hw_params *p, struct snd_pcm_hw_ru
405405
static int imx_aif_startup(struct snd_pcm_substream *substream)
406406
{
407407
struct snd_pcm_runtime *runtime = substream->runtime;
408-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
408+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
409409
struct snd_soc_card *card = rtd->card;
410410
struct imx_card_data *data = snd_soc_card_get_drvdata(card);
411411
struct dai_link_data *link_data = &data->link_data[rtd->num];

sound/soc/fsl/imx-hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct imx_hdmi_data {
3232
static int imx_hdmi_hw_params(struct snd_pcm_substream *substream,
3333
struct snd_pcm_hw_params *params)
3434
{
35-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
35+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
3636
struct imx_hdmi_data *data = snd_soc_card_get_drvdata(rtd->card);
3737
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
3838
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);

sound/soc/fsl/imx-pcm-rpmsg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ static int imx_rpmsg_pcm_prepare(struct snd_soc_component *component,
316316
struct snd_pcm_substream *substream)
317317
{
318318
struct snd_pcm_runtime *runtime = substream->runtime;
319-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
319+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
320320
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
321321
struct fsl_rpmsg *rpmsg = dev_get_drvdata(cpu_dai->dev);
322322

@@ -461,7 +461,7 @@ static int imx_rpmsg_pcm_trigger(struct snd_soc_component *component,
461461
struct snd_pcm_substream *substream, int cmd)
462462
{
463463
struct snd_pcm_runtime *runtime = substream->runtime;
464-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
464+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
465465
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
466466
struct fsl_rpmsg *rpmsg = dev_get_drvdata(cpu_dai->dev);
467467
int ret = 0;
@@ -515,7 +515,7 @@ static int imx_rpmsg_pcm_ack(struct snd_soc_component *component,
515515
struct snd_pcm_substream *substream)
516516
{
517517
struct snd_pcm_runtime *runtime = substream->runtime;
518-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
518+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
519519
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
520520
struct fsl_rpmsg *rpmsg = dev_get_drvdata(cpu_dai->dev);
521521
struct rpmsg_info *info = dev_get_drvdata(component->dev);

0 commit comments

Comments
 (0)