summaryrefslogtreecommitdiffstats
path: root/drivers/clk/sunxi/clk-factors.h
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2016-01-25 21:15:40 +0800
committerMaxime Ripard <maxime.ripard@free-electrons.com>2016-01-27 18:57:31 +0100
commit4cbeaebb8af1c86691d1a2d3328d82a01f4380a5 (patch)
tree65c31e18b9bf9a00dadb4a59e5c94f7889504837 /drivers/clk/sunxi/clk-factors.h
parent78ca95c76900e7587d6e076f8162a440f19431ae (diff)
downloadblackbird-obmc-linux-4cbeaebb8af1c86691d1a2d3328d82a01f4380a5.tar.gz
blackbird-obmc-linux-4cbeaebb8af1c86691d1a2d3328d82a01f4380a5.zip
clk: sunxi: factors: Add unregister function
sunxi's factors clk did not have an unregister function. This means multiple structs were leaked whenever a factors clk was unregistered. Add an unregister function for it. Also keep pointers to the mux and gate structs so they can be freed. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'drivers/clk/sunxi/clk-factors.h')
-rw-r--r--drivers/clk/sunxi/clk-factors.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/clk/sunxi/clk-factors.h b/drivers/clk/sunxi/clk-factors.h
index 060319be2b99..7ea1379a7cda 100644
--- a/drivers/clk/sunxi/clk-factors.h
+++ b/drivers/clk/sunxi/clk-factors.h
@@ -34,6 +34,9 @@ struct clk_factors {
const struct clk_factors_config *config;
void (*get_factors) (u32 *rate, u32 parent, u8 *n, u8 *k, u8 *m, u8 *p);
spinlock_t *lock;
+ /* for cleanup */
+ struct clk_mux *mux;
+ struct clk_gate *gate;
};
struct clk *sunxi_factors_register(struct device_node *node,
@@ -41,4 +44,6 @@ struct clk *sunxi_factors_register(struct device_node *node,
spinlock_t *lock,
void __iomem *reg);
+void sunxi_factors_unregister(struct device_node *node, struct clk *clk);
+
#endif
OpenPOWER on IntegriCloud