]> git.baikalelectronics.ru Git - kernel.git/commit
clk: add api to get clk consumer from clk_hw
authorJerome Brunet <jbrunet@baylibre.com>
Wed, 21 Oct 2020 16:21:46 +0000 (18:21 +0200)
committerStephen Boyd <sboyd@kernel.org>
Sat, 14 Nov 2020 20:56:57 +0000 (12:56 -0800)
commit172c5c952faa8d04125f14c4f03887f0ba07e3ee
treec03c9dccd1dca036137efdd6e4bad005484a5abb
parent854af55bdce7e2b579046b8328a1e3cf6b64e51b
clk: add api to get clk consumer from clk_hw

clk_register() is deprecated. Using 'clk' member of struct clk_hw is
discouraged. With this constraint, it is difficult for driver to
register clocks using the clk_hw API and then use the clock with
the consumer API

This adds a simple helper, clk_hw_get_clk(), to get a struct clk from
a struct clk_hw. Like other clk_get() variant, each call to this helper
must be balanced with a call to clk_put(). To make life easier on the
consumers, a memory managed version is provided as well.

Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20201021162147.563655-3-jbrunet@baylibre.com
Tested-by: Kevin Hilman <khilman@baylibre.com>
[sboyd@kernel.org: Fix kernel-doc]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk.c
include/linux/clk-provider.h