clk: add clk_unregister_fixed_rate()
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 6 Jan 2016 04:25:10 +0000 (13:25 +0900)
committerStephen Boyd <sboyd@codeaurora.org>
Sat, 30 Jan 2016 00:37:24 +0000 (16:37 -0800)
Allow to unregister fixed rate clock.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/clk-fixed-rate.c
include/linux/clk-provider.h

index e156beb871f085eba0075dd083be95ab2e81b47a..6858bfc548a920e57b6f25675bf974ee94744d9d 100644 (file)
@@ -104,6 +104,19 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
 }
 EXPORT_SYMBOL_GPL(clk_register_fixed_rate);
 
+void clk_unregister_fixed_rate(struct clk *clk)
+{
+       struct clk_hw *hw;
+
+       hw = __clk_get_hw(clk);
+       if (!hw)
+               return;
+
+       clk_unregister(clk);
+       kfree(to_clk_fixed_rate(hw));
+}
+EXPORT_SYMBOL_GPL(clk_unregister_fixed_rate);
+
 #ifdef CONFIG_OF
 /**
  * of_fixed_clk_setup() - Setup function for simple fixed rate clock
index 3641eecf462ab9030480ad014814461b838892e5..fabe5bedbba6b2f7725ba625960b15b27e11ae0f 100644 (file)
@@ -285,7 +285,7 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
 struct clk *clk_register_fixed_rate_with_accuracy(struct device *dev,
                const char *name, const char *parent_name, unsigned long flags,
                unsigned long fixed_rate, unsigned long fixed_accuracy);
-
+void clk_unregister_fixed_rate(struct clk *clk);
 void of_fixed_clk_setup(struct device_node *np);
 
 /**