[alsa-devel] [PATCH 1/4 v6] ASoC: add .of_xlate_dai_name callback on struct snd_soc_dai_driver
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Wed Feb 20 01:52:53 CET 2013
Hi Stephen
Thank you for checking patch
> > + if (dai->id != args->args[0])
> > + return NULL;
>
> This rather assumes that drivers with multiple DAIs will order the list
> of DAIs passed to snd_soc_register_dais() in the same order as the
> numbering in their device tree binding document. That seems a little
> optimistic.
>
> The whole reason for adding an .of_xlate_dai_name function to the DAI
> driver was to allow drivers to implement their own translation without
> any dependency on ASoC internals, orders of lists of DAIs registered
> with ASoC, etc.
Ahh.. I see
Thank you for pointing it.
> > + if (dai->dev->of_node != args.np)
> > + continue;
> > +
> > + if (dai->driver->of_xlate_dai_name) {
> > + name = dai->driver->of_xlate_dai_name(dai, &args);
> > + if (name)
> > + return name;
>
> This probably also wants to return an integer to differentiate between
> e.g. "invalid value" and "no driver found yet".
I see, will fix it.
Best regards
---
Kuninori Morimoto
More information about the Alsa-devel
mailing list