diff options
author | Jerome Brunet <jbrunet@baylibre.com> | 2019-09-24 15:39:54 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2019-12-24 05:53:13 +0300 |
commit | f873744c29036cc734ec8ecbedd1a451ce61cef2 (patch) | |
tree | 7ed67a94fa3651939b423674fc55b08b17c4aafc /drivers/clk/clk.c | |
parent | 89d079dc17e8a32397de827cc85c1f4911b90424 (diff) | |
download | linux-f873744c29036cc734ec8ecbedd1a451ce61cef2.tar.xz |
clk: add terminate callback to clk_ops
Add a terminate callback to the clk_ops to release the resources
claimed in .init()
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lkml.kernel.org/r/20190924123954.31561-4-jbrunet@baylibre.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r-- | drivers/clk/clk.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index b8dc848a04f7..ef4416721777 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3862,6 +3862,7 @@ static void clk_core_evict_parent_cache(struct clk_core *core) void clk_unregister(struct clk *clk) { unsigned long flags; + const struct clk_ops *ops; if (!clk || WARN_ON_ONCE(IS_ERR(clk))) return; @@ -3870,7 +3871,8 @@ void clk_unregister(struct clk *clk) clk_prepare_lock(); - if (clk->core->ops == &clk_nodrv_ops) { + ops = clk->core->ops; + if (ops == &clk_nodrv_ops) { pr_err("%s: unregistered clock: %s\n", __func__, clk->core->name); goto unlock; @@ -3883,6 +3885,9 @@ void clk_unregister(struct clk *clk) clk->core->ops = &clk_nodrv_ops; clk_enable_unlock(flags); + if (ops->terminate) + ops->terminate(clk->core->hw); + if (!hlist_empty(&clk->core->children)) { struct clk_core *child; struct hlist_node *t; |