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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux