[alsa-devel] [PATCH 4/4 v6] ASoC: simple-card: add Device Tree support
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Wed Feb 20 01:48:19 CET 2013
Hi Lars
Thank you for checking patch
> > +- simple-audio,dev : phandle and port for CPU/CODEC
> > +- simple-audio,frame-master : frame master
> > +- simple-audio,bitclock-master : bitclock master
> > +#sound-dai-cells integer is required on simple-audio,dev phandle's node
>
> Shouldn't the names of '#sound-dai-cells' and 'simple-audio,dev' kind of
> match? E.g. '#sound-dai-cells' and 'sound-dai'. Maybe drop the sound, since
> the a in dai kind of implies this.
Thank you, but I would like to keep "simple-audio" name for it too.
So, can I use
simple-audio-dai
#simple-audio-dai-cells
> > +static struct device_node*
> > +__asoc_simple_card_parse_of(struct device_node *np,
> > + struct asoc_simple_dai *dai)
> > +{
> > + struct device_node *node;
> > + char prop[128];
> > +
> > + /* get "simple-audio,dev = <&phandle port>" */
> > + snprintf(prop, sizeof(prop), "simple-audio,dev");
>
> Why do you need the extra buffer? Can you just pass, "simple-audio,dev"
> directly to of_parse_phandle?
Indeed, thank you.
> > + node = of_parse_phandle(np, prop, 0);
> > + if (!node)
> > + return NULL;
> > +
> > + of_node_put(node);
>
> You shouldn't drop the reference until you are done processing it. Which in
> this case is only after the device has been unregistered, since you pass the
> node on to the ASoC core.
I see, will fix
Best regards
---
Kuninori Morimoto
More information about the Alsa-devel
mailing list