Add a resource managed clk_get() to simplify clock usage in
drivers. This allows driver authors to "get and forget" about
their clocks by automatically calling clk_put() when the driver
is detached. This also encourages clock consumers to use the
clk_get() API correctly by passing in a struct device as an
argument.
Change-Id: I1ed53cd3c26c0390fa30cd3c3dca14bcdd59939f
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
clkdev may incorrectly cause a clkdev entry with a NULL clk to return
-ENOENT. This is not the intention of this code; -ENOENT should only
be returned if the clock entry can not be found in the table. Fix
this.
Reported-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
factorise some generic infrastructure to assist looking up struct clks
for the ARM & SH architecture.
as the code is identical at 99%
put the arch specific code for allocation as example in asm/clkdev.h
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>