lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 9 Dec 2016 00:20:05 +0000
From:   Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To:     Stephen Boyd <sboyd@...eaurora.org>
CC:     Russell King - ARM Linux <linux@...linux.org.uk>,
        Rob Herring <robh@...nel.org>,
        Linux-ALSA <alsa-devel@...a-project.org>,
        Linux-DT <devicetree@...r.kernel.org>,
        Michael Turquette <mturquette@...libre.com>,
        Linux-Kernel <linux-kernel@...r.kernel.org>,
        Mark Brown <broonie@...nel.org>, <linux-clk@...r.kernel.org>,
        Linux-ARM <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 2/3] ASoC: simple-card: use devm_get_clk_from_child()


Hi Stephen

> > @@ -111,14 +112,13 @@ int asoc_simple_card_parse_clk(struct device_node *node,
> >  	 *  or "system-clock-frequency = <xxx>"
> >  	 *  or device's module clock.
> >  	 */
> > -	clk = of_clk_get(node, 0);
> > +	clk = devm_get_clk_from_child(dev, node, NULL);
> >  	if (!IS_ERR(clk)) {
> >  		simple_dai->sysclk = clk_get_rate(clk);
> > -		simple_dai->clk = clk;
> >  	} else if (!of_property_read_u32(node, "system-clock-frequency", &val)) {
> >  		simple_dai->sysclk = val;
> >  	} else {
> > -		clk = of_clk_get(dai_of_node, 0);
> > +		clk = devm_get_clk_from_child(dev, dai_of_node, NULL);
> 
> 
> I was confused for a minute about how the second of_clk_get()
> call with the dai_link node could work. Is that documented
> anywhere or used by anyone? It seems like it's at least another
> child node of the sound node (which is dev here) so it seems ok.

Documentation/devicetree/bindings/sound/simple-card.txt
explains 1st of_clk_get will be used as "if needed",
2nd of_clk_get will be used as "not needed pattern".
1st pattern will use specific clock, 2nd pattern will use
"cpu" or "codec" clock.
2nd one was added by someone (I forgot), and many driver is
based on this feature.

Best regards
---
Kuninori Morimoto

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ