File tree Expand file tree Collapse file tree 5 files changed +37
-35
lines changed Expand file tree Collapse file tree 5 files changed +37
-35
lines changed Original file line number Diff line number Diff line change @@ -617,12 +617,15 @@ static int bxt_card_late_probe(struct snd_soc_card *card)
617
617
snd_soc_dapm_add_routes (& card -> dapm , broxton_map ,
618
618
ARRAY_SIZE (broxton_map ));
619
619
620
- pcm = list_first_entry (& ctx -> hdmi_pcm_list , struct bxt_hdmi_pcm ,
621
- head );
622
- component = pcm -> codec_dai -> component ;
620
+ if (list_empty (& ctx -> hdmi_pcm_list ))
621
+ return - EINVAL ;
623
622
624
- if (ctx -> common_hdmi_codec_drv )
623
+ if (ctx -> common_hdmi_codec_drv ) {
624
+ pcm = list_first_entry (& ctx -> hdmi_pcm_list , struct bxt_hdmi_pcm ,
625
+ head );
626
+ component = pcm -> codec_dai -> component ;
625
627
return hda_dsp_hdmi_build_controls (card , component );
628
+ }
626
629
627
630
list_for_each_entry (pcm , & ctx -> hdmi_pcm_list , head ) {
628
631
component = pcm -> codec_dai -> component ;
@@ -643,9 +646,6 @@ static int bxt_card_late_probe(struct snd_soc_card *card)
643
646
i ++ ;
644
647
}
645
648
646
- if (!component )
647
- return - EINVAL ;
648
-
649
649
return hdac_hdmi_jack_port_init (component , & card -> dapm );
650
650
}
651
651
Original file line number Diff line number Diff line change @@ -529,12 +529,15 @@ static int bxt_card_late_probe(struct snd_soc_card *card)
529
529
int err , i = 0 ;
530
530
char jack_name [NAME_SIZE ];
531
531
532
- pcm = list_first_entry (& ctx -> hdmi_pcm_list , struct bxt_hdmi_pcm ,
533
- head );
534
- component = pcm -> codec_dai -> component ;
532
+ if (list_empty (& ctx -> hdmi_pcm_list ))
533
+ return - EINVAL ;
535
534
536
- if (ctx -> common_hdmi_codec_drv )
535
+ if (ctx -> common_hdmi_codec_drv ) {
536
+ pcm = list_first_entry (& ctx -> hdmi_pcm_list , struct bxt_hdmi_pcm ,
537
+ head );
538
+ component = pcm -> codec_dai -> component ;
537
539
return hda_dsp_hdmi_build_controls (card , component );
540
+ }
538
541
539
542
list_for_each_entry (pcm , & ctx -> hdmi_pcm_list , head ) {
540
543
component = pcm -> codec_dai -> component ;
@@ -555,9 +558,6 @@ static int bxt_card_late_probe(struct snd_soc_card *card)
555
558
i ++ ;
556
559
}
557
560
558
- if (!component )
559
- return - EINVAL ;
560
-
561
561
return hdac_hdmi_jack_port_init (component , & card -> dapm );
562
562
}
563
563
Original file line number Diff line number Diff line change @@ -241,12 +241,15 @@ static int sof_card_late_probe(struct snd_soc_card *card)
241
241
struct hdmi_pcm * pcm ;
242
242
int ret , i = 0 ;
243
243
244
- pcm = list_first_entry (& ctx -> hdmi_pcm_list , struct hdmi_pcm ,
245
- head );
246
- component = pcm -> codec_dai -> component ;
244
+ if (list_empty (& ctx -> hdmi_pcm_list ))
245
+ return - EINVAL ;
247
246
248
- if (ctx -> common_hdmi_codec_drv )
247
+ if (ctx -> common_hdmi_codec_drv ) {
248
+ pcm = list_first_entry (& ctx -> hdmi_pcm_list , struct hdmi_pcm ,
249
+ head );
250
+ component = pcm -> codec_dai -> component ;
249
251
return hda_dsp_hdmi_build_controls (card , component );
252
+ }
250
253
251
254
list_for_each_entry (pcm , & ctx -> hdmi_pcm_list , head ) {
252
255
component = pcm -> codec_dai -> component ;
@@ -265,8 +268,6 @@ static int sof_card_late_probe(struct snd_soc_card *card)
265
268
266
269
i ++ ;
267
270
}
268
- if (!component )
269
- return - EINVAL ;
270
271
271
272
return hdac_hdmi_jack_port_init (component , & card -> dapm );
272
273
}
Original file line number Diff line number Diff line change @@ -534,15 +534,18 @@ static int glk_card_late_probe(struct snd_soc_card *card)
534
534
struct snd_soc_component * component = NULL ;
535
535
char jack_name [NAME_SIZE ];
536
536
struct glk_hdmi_pcm * pcm ;
537
- int err = 0 ;
537
+ int err ;
538
538
int i = 0 ;
539
539
540
- pcm = list_first_entry (& ctx -> hdmi_pcm_list , struct glk_hdmi_pcm ,
541
- head );
542
- component = pcm -> codec_dai -> component ;
540
+ if (list_empty (& ctx -> hdmi_pcm_list ))
541
+ return - EINVAL ;
543
542
544
- if (ctx -> common_hdmi_codec_drv )
543
+ if (ctx -> common_hdmi_codec_drv ) {
544
+ pcm = list_first_entry (& ctx -> hdmi_pcm_list , struct glk_hdmi_pcm ,
545
+ head );
546
+ component = pcm -> codec_dai -> component ;
545
547
return hda_dsp_hdmi_build_controls (card , component );
548
+ }
546
549
547
550
list_for_each_entry (pcm , & ctx -> hdmi_pcm_list , head ) {
548
551
component = pcm -> codec_dai -> component ;
@@ -563,9 +566,6 @@ static int glk_card_late_probe(struct snd_soc_card *card)
563
566
i ++ ;
564
567
}
565
568
566
- if (!component )
567
- return - EINVAL ;
568
-
569
569
return hdac_hdmi_jack_port_init (component , & card -> dapm );
570
570
}
571
571
Original file line number Diff line number Diff line change @@ -273,19 +273,22 @@ static int sof_card_late_probe(struct snd_soc_card *card)
273
273
struct snd_soc_component * component = NULL ;
274
274
char jack_name [NAME_SIZE ];
275
275
struct sof_hdmi_pcm * pcm ;
276
- int err = 0 ;
276
+ int err ;
277
277
int i = 0 ;
278
278
279
279
/* HDMI is not supported by SOF on Baytrail/CherryTrail */
280
280
if (is_legacy_cpu )
281
281
return 0 ;
282
282
283
- pcm = list_first_entry (& ctx -> hdmi_pcm_list , struct sof_hdmi_pcm ,
284
- head );
285
- component = pcm -> codec_dai -> component ;
283
+ if (list_empty (& ctx -> hdmi_pcm_list ))
284
+ return - EINVAL ;
286
285
287
- if (ctx -> common_hdmi_codec_drv )
286
+ if (ctx -> common_hdmi_codec_drv ) {
287
+ pcm = list_first_entry (& ctx -> hdmi_pcm_list , struct sof_hdmi_pcm ,
288
+ head );
289
+ component = pcm -> codec_dai -> component ;
288
290
return hda_dsp_hdmi_build_controls (card , component );
291
+ }
289
292
290
293
list_for_each_entry (pcm , & ctx -> hdmi_pcm_list , head ) {
291
294
component = pcm -> codec_dai -> component ;
@@ -305,8 +308,6 @@ static int sof_card_late_probe(struct snd_soc_card *card)
305
308
306
309
i ++ ;
307
310
}
308
- if (!component )
309
- return - EINVAL ;
310
311
311
312
return hdac_hdmi_jack_port_init (component , & card -> dapm );
312
313
}
You can’t perform that action at this time.
0 commit comments