aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/clk/clk-composite.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2016-03-23 17:38:24 +0100
committerStephen Boyd <sboyd@codeaurora.org>2016-04-21 14:43:28 -0700
commit92a39d9043ba5ff98adb1c31491f00c7bea5466e (patch)
tree591831d33d7b0c8181786877feae2ffcc907872f /drivers/clk/clk-composite.c
parentLinux 4.6-rc1 (diff)
downloadwireguard-linux-92a39d9043ba5ff98adb1c31491f00c7bea5466e.tar.xz
wireguard-linux-92a39d9043ba5ff98adb1c31491f00c7bea5466e.zip
clk: composite: Add unregister function
The composite clock didn't have any unregistration function, which forced us to use clk_unregister directly on it. While it was already not great from an API point of view, it also meant that we were leaking the clk_composite structure allocated in clk_register_composite. Add a clk_unregister_composite function to fix this. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/clk-composite.c')
-rw-r--r--drivers/clk/clk-composite.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index 1f903e1f86a2..b0f3b84ebd13 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -286,3 +286,18 @@ err:
kfree(composite);
return clk;
}
+
+void clk_unregister_composite(struct clk *clk)
+{
+ struct clk_composite *composite;
+ struct clk_hw *hw;
+
+ hw = __clk_get_hw(clk);
+ if (!hw)
+ return;
+
+ composite = to_clk_composite(hw);
+
+ clk_unregister(clk);
+ kfree(composite);
+}