diff options
author | Daniel Thompson <daniel.thompson@linaro.org> | 2015-06-10 16:04:54 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-06-10 17:19:43 -0400 |
commit | 3037e9ea780027d41baaaabb68a749e49e7c8260 (patch) | |
tree | 84af70ca39344f3446e196ff0bd0929e9481eaa7 | |
parent | b41c7bfa27f221a567e33b44aa5395adfe042229 (diff) |
clk: fixed: Add comment to clk_fixed_set_rate
Currently it is not made explicit why clk_fixed_set_rate() can ignore
its arguments and unconditionally return success. Add a comment
to explain this.
We also mark the clk_ops table const since it should never be
modified at runtime.
Suggested-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r-- | drivers/clk/clk-fixed-factor.c | 8 | ||||
-rw-r--r-- | include/linux/clk-provider.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c index e186db263d5e..fccabe497f6e 100644 --- a/drivers/clk/clk-fixed-factor.c +++ b/drivers/clk/clk-fixed-factor.c | |||
@@ -55,10 +55,16 @@ static long clk_factor_round_rate(struct clk_hw *hw, unsigned long rate, | |||
55 | static int clk_factor_set_rate(struct clk_hw *hw, unsigned long rate, | 55 | static int clk_factor_set_rate(struct clk_hw *hw, unsigned long rate, |
56 | unsigned long parent_rate) | 56 | unsigned long parent_rate) |
57 | { | 57 | { |
58 | /* | ||
59 | * We must report success but we can do so unconditionally because | ||
60 | * clk_factor_round_rate returns values that ensure this call is a | ||
61 | * nop. | ||
62 | */ | ||
63 | |||
58 | return 0; | 64 | return 0; |
59 | } | 65 | } |
60 | 66 | ||
61 | struct clk_ops clk_fixed_factor_ops = { | 67 | const struct clk_ops clk_fixed_factor_ops = { |
62 | .round_rate = clk_factor_round_rate, | 68 | .round_rate = clk_factor_round_rate, |
63 | .set_rate = clk_factor_set_rate, | 69 | .set_rate = clk_factor_set_rate, |
64 | .recalc_rate = clk_factor_recalc_rate, | 70 | .recalc_rate = clk_factor_recalc_rate, |
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 2e5df069ca34..4a943d13625b 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
@@ -459,7 +459,7 @@ struct clk_fixed_factor { | |||
459 | unsigned int div; | 459 | unsigned int div; |
460 | }; | 460 | }; |
461 | 461 | ||
462 | extern struct clk_ops clk_fixed_factor_ops; | 462 | extern const struct clk_ops clk_fixed_factor_ops; |
463 | struct clk *clk_register_fixed_factor(struct device *dev, const char *name, | 463 | struct clk *clk_register_fixed_factor(struct device *dev, const char *name, |
464 | const char *parent_name, unsigned long flags, | 464 | const char *parent_name, unsigned long flags, |
465 | unsigned int mult, unsigned int div); | 465 | unsigned int mult, unsigned int div); |