Skip to content

Commit

Permalink
clk: add clk_unregister_fixed_factor()
Browse files Browse the repository at this point in the history
Allow to unregister fixed factor clock.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
  • Loading branch information
Masahiro Yamada authored and Stephen Boyd committed Jan 30, 2016
1 parent 5540ac8 commit cbf9591
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/clk/clk-fixed-factor.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
}
EXPORT_SYMBOL_GPL(clk_register_fixed_factor);

void clk_unregister_fixed_factor(struct clk *clk)
{
struct clk_hw *hw;

hw = __clk_get_hw(clk);
if (!hw)
return;

clk_unregister(clk);
kfree(to_clk_fixed_factor(hw));
}
EXPORT_SYMBOL_GPL(clk_unregister_fixed_factor);

#ifdef CONFIG_OF
/**
* of_fixed_factor_clk_setup() - Setup function for simple fixed factor clock
Expand Down
1 change: 1 addition & 0 deletions include/linux/clk-provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ extern const struct clk_ops clk_fixed_factor_ops;
struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
const char *parent_name, unsigned long flags,
unsigned int mult, unsigned int div);
void clk_unregister_fixed_factor(struct clk *clk);

/**
* struct clk_fractional_divider - adjustable fractional divider clock
Expand Down

0 comments on commit cbf9591

Please sign in to comment.