Message ID | 87bjup6wx3.wl-kuninori.morimoto.gx@renesas.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | ASoC: bug fix patches | expand |
On Wed, Feb 26, 2025 at 06:29:44AM +0000, Kuninori Morimoto wrote: > commit 0ecd24a6d8b2 ("ASoC: hdmi-codec: dump ELD through procfs") adds > "eld#%d" entry for sound proc. It is using DAI ID. But it is possible to > have duplicate DAI ID on same Sound Card. In such case, we will get below > error. To avoid duplicate entry name, use RTD ID instead of DAI ID. Acked-by: Mark Brown <broonie@kernel.org> Given that this doesn't depend on the first two patches it'd probably have been better sent separately, especially since it needs to get merged via a separate tree.
Hi Mark, Takashi > > commit 0ecd24a6d8b2 ("ASoC: hdmi-codec: dump ELD through procfs") adds > > "eld#%d" entry for sound proc. It is using DAI ID. But it is possible to > > have duplicate DAI ID on same Sound Card. In such case, we will get below > > error. To avoid duplicate entry name, use RTD ID instead of DAI ID. > > Acked-by: Mark Brown <broonie@kernel.org> > > Given that this doesn't depend on the first two patches it'd probably > have been better sent separately, especially since it needs to get > merged via a separate tree. OK, thanks. Will do # I noticed that the Subject was not matched, and the patch is missing # Fixes tag. I will post it as v2 patch, soon Thank you for your help !! Best regards --- Kuninori Morimoto
Hi Takashi > > > commit 0ecd24a6d8b2 ("ASoC: hdmi-codec: dump ELD through procfs") adds > > > "eld#%d" entry for sound proc. It is using DAI ID. But it is possible to > > > have duplicate DAI ID on same Sound Card. In such case, we will get below > > > error. To avoid duplicate entry name, use RTD ID instead of DAI ID. > > > > Acked-by: Mark Brown <broonie@kernel.org> > > > > Given that this doesn't depend on the first two patches it'd probably > > have been better sent separately, especially since it needs to get > > merged via a separate tree. > > OK, thanks. Will do > > # I noticed that the Subject was not matched, and the patch is missing > # Fixes tag. I will post it as v2 patch, soon This patch has "ASoC: " on Subject, but commit 0ecd24a6d8b2 exists only on your tree, not on Mark tree. Will post v2 Thank you for your help !! Best regards --- Kuninori Morimoto
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 17019b1d680b..bc01ff65bd6f 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -842,12 +842,28 @@ static void print_eld_info(struct snd_info_entry *entry, static int hdmi_dai_proc_new(struct hdmi_codec_priv *hcp, struct snd_soc_dai *dai) { + struct snd_soc_component *component = dai->component; + struct snd_soc_card *card = component->card; + struct snd_soc_dai *d; + struct snd_soc_pcm_runtime *rtd; struct snd_info_entry *entry; char name[32]; - int err; + int err, i, id = 0; - snprintf(name, sizeof(name), "eld#%d", dai->id); - err = snd_card_proc_new(dai->component->card->snd_card, name, &entry); + /* + * To avoid duplicate proc entry, find its rtd and use rtd->id + * instead of dai->id + */ + for_each_card_rtds(card, rtd) { + for_each_rtd_dais(rtd, i, d) + if (d == dai) { + id = rtd->id; + goto found; + } + } +found: + snprintf(name, sizeof(name), "eld#%d", id); + err = snd_card_proc_new(card->snd_card, name, &entry); if (err < 0) return err;