[PATCH v2] clkdev: add devm_of_clk_get()

From
Russell King - ARM Linux <linux@armlinux.org.uk>
Date
2016-07-07 12:26:56
Also in
alsa-devel, linux-clk, linux-devicetree, lkml
Reply to
Kuninori Morimoto, 2016-07-07
On Thu, Jul 07, 2016 at 09:54:03AM +0000, Kuninori Morimoto wrote:
Hi Michael
quoted
quoted
+struct clk *devm_of_clk_get(struct device *dev,
+                           struct device_node *np, int index)
Any reason not to use devm_clk_get? Why do we need this helper?
Because of_clk_get() can parse "clocks", "#clock-cells" on DT.
clk_get() should also work just fine.  clk_get() uses
__of_clk_get_by_name() internally, which uses "clock-names" to
locate the index if a connection id is given.  of_clk_get() allows
lookup of a clock by index only, omitting the name, which means
you need to coordinate the order of clocks in DT with the order
that the driver wants... which sounds error prone to me.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
Thread (16 messages) 16 messages, 4 authors, last reply 2016-12-01
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help