From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Subject: Re: [PATCH v4 7/9] ASoC: simple-card-utils: add asoc_simple_card_parse_graph_dai() Date: Tue, 21 Mar 2017 02:03:40 +0000 Message-ID: <87fui7bd9b.wl%kuninori.morimoto.gx@renesas.com> References: <8760jdivfm.wl%kuninori.morimoto.gx@renesas.com> <87vardhgia.wl%kuninori.morimoto.gx@renesas.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="US-ASCII" Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Rob Herring Cc: Mark Brown , Linux-ALSA , Simon , Linux-DT List-Id: devicetree@vger.kernel.org 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 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html