Skip to content

Commit 2ab9a40

Browse files
morimotobroonie
authored andcommitted
ASoC: intel: use asoc_substream_to_rtd()
Now we can use asoc_substream_to_rtd() macro, let's use it. Signed-off-by: Kuninori Morimoto <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2207b93 commit 2ab9a40

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

sound/soc/intel/atom/sst-mfld-platform-pcm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static int sst_platform_init_stream(struct snd_pcm_substream *substream)
274274
{
275275
struct sst_runtime_stream *stream =
276276
substream->runtime->private_data;
277-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
277+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
278278
int ret_val;
279279

280280
dev_dbg(rtd->dev, "setting buffer ptr param\n");
@@ -582,7 +582,7 @@ static int sst_soc_trigger(struct snd_soc_component *component,
582582
int ret_val = 0, str_id;
583583
struct sst_runtime_stream *stream;
584584
int status;
585-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
585+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
586586

587587
dev_dbg(rtd->dev, "%s called\n", __func__);
588588
if (substream->pcm->internal)
@@ -630,7 +630,7 @@ static snd_pcm_uframes_t sst_soc_pointer(struct snd_soc_component *component,
630630
struct sst_runtime_stream *stream;
631631
int ret_val, status;
632632
struct pcm_stream_info *str_info;
633-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
633+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
634634

635635
stream = substream->runtime->private_data;
636636
status = sst_get_stream_status(stream);

sound/soc/intel/baytrail/sst-baytrail-pcm.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static int sst_byt_pcm_hw_params(struct snd_soc_component *component,
6262
struct snd_pcm_substream *substream,
6363
struct snd_pcm_hw_params *params)
6464
{
65-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
65+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
6666
struct sst_byt_priv_data *pdata = snd_soc_component_get_drvdata(component);
6767
struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream];
6868
struct sst_byt *byt = pdata->byt;
@@ -121,7 +121,7 @@ static int sst_byt_pcm_hw_params(struct snd_soc_component *component,
121121

122122
static int sst_byt_pcm_restore_stream_context(struct snd_pcm_substream *substream)
123123
{
124-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
124+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
125125
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
126126
struct sst_byt_priv_data *pdata = snd_soc_component_get_drvdata(component);
127127
struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream];
@@ -155,7 +155,7 @@ static void sst_byt_pcm_work(struct work_struct *work)
155155
static int sst_byt_pcm_trigger(struct snd_soc_component *component,
156156
struct snd_pcm_substream *substream, int cmd)
157157
{
158-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
158+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
159159
struct sst_byt_priv_data *pdata = snd_soc_component_get_drvdata(component);
160160
struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream];
161161
struct sst_byt *byt = pdata->byt;
@@ -197,7 +197,7 @@ static u32 byt_notify_pointer(struct sst_byt_stream *stream, void *data)
197197
struct sst_byt_pcm_data *pcm_data = data;
198198
struct snd_pcm_substream *substream = pcm_data->substream;
199199
struct snd_pcm_runtime *runtime = substream->runtime;
200-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
200+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
201201
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
202202
struct sst_byt_priv_data *pdata = snd_soc_component_get_drvdata(component);
203203
struct sst_byt *byt = pdata->byt;
@@ -219,7 +219,7 @@ static u32 byt_notify_pointer(struct sst_byt_stream *stream, void *data)
219219
static snd_pcm_uframes_t sst_byt_pcm_pointer(struct snd_soc_component *component,
220220
struct snd_pcm_substream *substream)
221221
{
222-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
222+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
223223
struct snd_pcm_runtime *runtime = substream->runtime;
224224
struct sst_byt_priv_data *pdata = snd_soc_component_get_drvdata(component);
225225
struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream];
@@ -232,7 +232,7 @@ static snd_pcm_uframes_t sst_byt_pcm_pointer(struct snd_soc_component *component
232232
static int sst_byt_pcm_open(struct snd_soc_component *component,
233233
struct snd_pcm_substream *substream)
234234
{
235-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
235+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
236236
struct sst_byt_priv_data *pdata = snd_soc_component_get_drvdata(component);
237237
struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream];
238238
struct sst_byt *byt = pdata->byt;
@@ -260,7 +260,7 @@ static int sst_byt_pcm_open(struct snd_soc_component *component,
260260
static int sst_byt_pcm_close(struct snd_soc_component *component,
261261
struct snd_pcm_substream *substream)
262262
{
263-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
263+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
264264
struct sst_byt_priv_data *pdata = snd_soc_component_get_drvdata(component);
265265
struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream];
266266
struct sst_byt *byt = pdata->byt;
@@ -286,7 +286,7 @@ static int sst_byt_pcm_mmap(struct snd_soc_component *component,
286286
struct snd_pcm_substream *substream,
287287
struct vm_area_struct *vma)
288288
{
289-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
289+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
290290

291291
dev_dbg(rtd->dev, "PCM: mmap\n");
292292
return snd_pcm_lib_default_mmap(substream, vma);

sound/soc/intel/haswell/sst-haswell-pcm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static int hsw_pcm_hw_params(struct snd_soc_component *component,
462462
struct snd_pcm_substream *substream,
463463
struct snd_pcm_hw_params *params)
464464
{
465-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
465+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
466466
struct snd_pcm_runtime *runtime = substream->runtime;
467467
struct hsw_priv_data *pdata = snd_soc_component_get_drvdata(component);
468468
struct hsw_pcm_data *pcm_data;
@@ -652,7 +652,7 @@ static int hsw_pcm_hw_params(struct snd_soc_component *component,
652652
static int hsw_pcm_trigger(struct snd_soc_component *component,
653653
struct snd_pcm_substream *substream, int cmd)
654654
{
655-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
655+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
656656
struct hsw_priv_data *pdata = snd_soc_component_get_drvdata(component);
657657
struct hsw_pcm_data *pcm_data;
658658
struct sst_hsw_stream *sst_stream;
@@ -695,7 +695,7 @@ static u32 hsw_notify_pointer(struct sst_hsw_stream *stream, void *data)
695695
struct hsw_pcm_data *pcm_data = data;
696696
struct snd_pcm_substream *substream = pcm_data->substream;
697697
struct snd_pcm_runtime *runtime = substream->runtime;
698-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
698+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
699699
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
700700
struct hsw_priv_data *pdata = snd_soc_component_get_drvdata(component);
701701
struct sst_hsw *hsw = pdata->hsw;
@@ -760,7 +760,7 @@ static u32 hsw_notify_pointer(struct sst_hsw_stream *stream, void *data)
760760
static snd_pcm_uframes_t hsw_pcm_pointer(struct snd_soc_component *component,
761761
struct snd_pcm_substream *substream)
762762
{
763-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
763+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
764764
struct snd_pcm_runtime *runtime = substream->runtime;
765765
struct hsw_priv_data *pdata = snd_soc_component_get_drvdata(component);
766766
struct hsw_pcm_data *pcm_data;
@@ -785,7 +785,7 @@ static snd_pcm_uframes_t hsw_pcm_pointer(struct snd_soc_component *component,
785785
static int hsw_pcm_open(struct snd_soc_component *component,
786786
struct snd_pcm_substream *substream)
787787
{
788-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
788+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
789789
struct hsw_priv_data *pdata = snd_soc_component_get_drvdata(component);
790790
struct hsw_pcm_data *pcm_data;
791791
struct sst_hsw *hsw = pdata->hsw;
@@ -818,7 +818,7 @@ static int hsw_pcm_open(struct snd_soc_component *component,
818818
static int hsw_pcm_close(struct snd_soc_component *component,
819819
struct snd_pcm_substream *substream)
820820
{
821-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
821+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
822822
struct hsw_priv_data *pdata = snd_soc_component_get_drvdata(component);
823823
struct hsw_pcm_data *pcm_data;
824824
struct sst_hsw *hsw = pdata->hsw;

sound/soc/intel/keembay/kmb_platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static int kmb_pcm_open(struct snd_soc_component *component,
191191
struct snd_pcm_substream *substream)
192192
{
193193
struct snd_pcm_runtime *runtime = substream->runtime;
194-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
194+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
195195
struct kmb_i2s_info *kmb_i2s;
196196

197197
kmb_i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));

sound/soc/intel/skylake/skl-pcm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ static int skl_link_hw_params(struct snd_pcm_substream *substream,
544544
{
545545
struct hdac_bus *bus = dev_get_drvdata(dai->dev);
546546
struct hdac_ext_stream *link_dev;
547-
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
547+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
548548
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
549549
struct skl_pipe_params p_params = {0};
550550
struct hdac_ext_link *link;
@@ -634,7 +634,7 @@ static int skl_link_hw_free(struct snd_pcm_substream *substream,
634634
struct snd_soc_dai *dai)
635635
{
636636
struct hdac_bus *bus = dev_get_drvdata(dai->dev);
637-
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
637+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
638638
struct hdac_ext_stream *link_dev =
639639
snd_soc_dai_get_dma_data(dai, substream);
640640
struct hdac_ext_link *link;
@@ -1071,7 +1071,7 @@ int skl_dai_load(struct snd_soc_component *cmp, int index,
10711071
static int skl_platform_soc_open(struct snd_soc_component *component,
10721072
struct snd_pcm_substream *substream)
10731073
{
1074-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
1074+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
10751075
struct snd_soc_dai_link *dai_link = rtd->dai_link;
10761076

10771077
dev_dbg(asoc_rtd_to_cpu(rtd, 0)->dev, "In %s:%s\n", __func__,
@@ -1225,7 +1225,7 @@ static int skl_platform_soc_mmap(struct snd_soc_component *component,
12251225
static u64 skl_adjust_codec_delay(struct snd_pcm_substream *substream,
12261226
u64 nsec)
12271227
{
1228-
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
1228+
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
12291229
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
12301230
u64 codec_frames, codec_nsecs;
12311231

0 commit comments

Comments
 (0)