From: Masahiro Yamada Date: Wed, 6 Jan 2016 04:25:10 +0000 (+0900) Subject: clk: add clk_unregister_fixed_rate() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0b225e41e369a7e03411bb67988513302a10382f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git clk: add clk_unregister_fixed_rate() Allow to unregister fixed rate clock. Signed-off-by: Masahiro Yamada Signed-off-by: Stephen Boyd --- diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c index e156beb871f0..6858bfc548a9 100644 --- a/drivers/clk/clk-fixed-rate.c +++ b/drivers/clk/clk-fixed-rate.c @@ -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 diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 3641eecf462a..fabe5bedbba6 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -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); /**