[alsa-devel] [PATCH v4 7/9] ASoC: simple-card-utils: add asoc_simple_card_parse_graph_dai()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Tue Mar 21 03:03:40 CET 2017


Hi Rob

Thank you for your review.

> > +int asoc_simple_card_parse_graph_dai(struct device_node *ep,
> > +                                    struct device_node **dai_of_node,
> > +                                    const char **dai_name)
> > +{
> > +       struct device_node *node;
> > +       struct of_phandle_args args;
> > +       int ret;
> > +
> > +       if (!ep)
> > +               return 0;
> > +       if (!dai_name)
> > +               return 0;
> > +
> > +       /*
> > +        * of_graph_get_port_parent() will call
> > +        * of_node_put(). So, call of_node_get() here
> > +        */
> > +       of_node_get(ep);
> > +       node = of_graph_get_port_parent(ep);
> > +
> > +       /* Get dai->name */
> > +       args.np         = node;
> > +       args.args[0]    = snd_soc_get_dai_id(ep);
> > +       args.args_count = (of_graph_get_endpoint_count(node) > 1);
> 
> This is a bit pointless. It's not the kernel's job to validate the DT.
> If you don't have a graph, then of_graph_get_port_parent would have
> already failed.

This function will be called from graph base driver, thus, it should have port parent.
args.args_count is checking <&xxxx> or <&xxxx n>

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list