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 @@ -841,12 +841,28 @@ static void print_eld_info(struct snd_info_entry *entry,
841841static int hdmi_dai_proc_new (struct hdmi_codec_priv * hcp ,
842842 struct snd_soc_dai * dai )
843843{
844+ struct snd_soc_component * component = dai -> component ;
845+ struct snd_soc_card * card = component -> card ;
846+ struct snd_soc_dai * d ;
847+ struct snd_soc_pcm_runtime * rtd ;
844848 struct snd_info_entry * entry ;
845849 char name [32 ];
846- int err ;
850+ int err , i , id = 0 ;
847851
848- snprintf (name , sizeof (name ), "eld#%d" , dai -> id );
849- err = snd_card_proc_new (dai -> component -> card -> snd_card , name , & entry );
852+ /*
853+ * To avoid duplicate proc entry, find its rtd and use rtd->id
854+ * instead of dai->id
855+ */
856+ for_each_card_rtds (card , rtd ) {
857+ for_each_rtd_dais (rtd , i , d )
858+ if (d == dai ) {
859+ id = rtd -> id ;
860+ goto found ;
861+ }
862+ }
863+ found :
864+ snprintf (name , sizeof (name ), "eld#%d" , id );
865+ err = snd_card_proc_new (card -> snd_card , name , & entry );
850866 if (err < 0 )
851867 return err ;
852868
You can’t perform that action at this time.
0 commit comments