File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -842,12 +842,28 @@ static void print_eld_info(struct snd_info_entry *entry,
842842static int hdmi_dai_proc_new (struct hdmi_codec_priv * hcp ,
843843 struct snd_soc_dai * dai )
844844{
845+ struct snd_soc_component * component = dai -> component ;
846+ struct snd_soc_card * card = component -> card ;
847+ struct snd_soc_dai * d ;
848+ struct snd_soc_pcm_runtime * rtd ;
845849 struct snd_info_entry * entry ;
846850 char name [32 ];
847- int err ;
851+ int err , i , id = 0 ;
848852
849- snprintf (name , sizeof (name ), "eld#%d" , dai -> id );
850- err = snd_card_proc_new (dai -> component -> card -> snd_card , name , & entry );
853+ /*
854+ * To avoid duplicate proc entry, find its rtd and use rtd->id
855+ * instead of dai->id
856+ */
857+ for_each_card_rtds (card , rtd ) {
858+ for_each_rtd_dais (rtd , i , d )
859+ if (d == dai ) {
860+ id = rtd -> id ;
861+ goto found ;
862+ }
863+ }
864+ found :
865+ snprintf (name , sizeof (name ), "eld#%d" , id );
866+ err = snd_card_proc_new (card -> snd_card , name , & entry );
851867 if (err < 0 )
852868 return err ;
853869
You can’t perform that action at this time.
0 commit comments