]> git.baikalelectronics.ru Git - kernel.git/commit
clk: Add (devm_)clk_get_optional() functions
authorPhil Edworthy <phil.edworthy@renesas.com>
Mon, 3 Dec 2018 11:13:09 +0000 (11:13 +0000)
committerStephen Boyd <sboyd@kernel.org>
Wed, 6 Feb 2019 18:33:10 +0000 (10:33 -0800)
commitec732d940c2c2753c76d9edda00186b8abbe09ba
tree60ea4fd636e291ff196d984885d2690571c9021b
parent97cafaacfba7ded880b804f13067a01fe1a258d2
clk: Add (devm_)clk_get_optional() functions

This adds clk_get_optional() and devm_clk_get_optional() functions to get
optional clocks.

They behave the same as (devm_)clk_get() except where there is no clock
producer. In this case, instead of returning -ENOENT, the function
returns NULL. This makes error checking simpler and allows
clk_prepare_enable, etc to be called on the returned reference
without additional checks.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Russell King <linux@armlinux.org.uk>
[sboyd@kernel.org: Document in devres.txt]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Documentation/driver-model/devres.txt
drivers/clk/clk-devres.c
include/linux/clk.h