diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2015-04-30 18:11:31 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-04-30 19:28:41 -0400 |
commit | 6e5ab41b1064eee6e3477f573370b2dda7d82bb7 (patch) | |
tree | aec90fe4049e5d71e5bf0b57c7c54424e9d42cf4 /drivers/clk/clk.c | |
parent | 4dff95dc9477a34de77d24c59dcf1dc593687fcf (diff) |
clk: Update some comments to reflect reality
The debugfs clk directory no longer expresses a clk tree. Update
the comments around that apporiately. Also drop comments about
prepare locks needing to be held as we have the proper
annotations with lockdep_assert_held().
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r-- | drivers/clk/clk.c | 51 |
1 files changed, 18 insertions, 33 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 0001b91f2b6e..43b7e7227056 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c | |||
@@ -162,7 +162,6 @@ static bool clk_core_is_enabled(struct clk_core *core) | |||
162 | return core->ops->is_enabled(core->hw); | 162 | return core->ops->is_enabled(core->hw); |
163 | } | 163 | } |
164 | 164 | ||
165 | /* caller must hold prepare_lock */ | ||
166 | static void clk_unprepare_unused_subtree(struct clk_core *core) | 165 | static void clk_unprepare_unused_subtree(struct clk_core *core) |
167 | { | 166 | { |
168 | struct clk_core *child; | 167 | struct clk_core *child; |
@@ -188,7 +187,6 @@ static void clk_unprepare_unused_subtree(struct clk_core *core) | |||
188 | } | 187 | } |
189 | } | 188 | } |
190 | 189 | ||
191 | /* caller must hold prepare_lock */ | ||
192 | static void clk_disable_unused_subtree(struct clk_core *core) | 190 | static void clk_disable_unused_subtree(struct clk_core *core) |
193 | { | 191 | { |
194 | struct clk_core *child; | 192 | struct clk_core *child; |
@@ -791,8 +789,7 @@ static unsigned long clk_core_round_rate_nolock(struct clk_core *core, | |||
791 | * @min_rate: returned rate must be greater than this rate | 789 | * @min_rate: returned rate must be greater than this rate |
792 | * @max_rate: returned rate must be less than this rate | 790 | * @max_rate: returned rate must be less than this rate |
793 | * | 791 | * |
794 | * Caller must hold prepare_lock. Useful for clk_ops such as .set_rate and | 792 | * Useful for clk_ops such as .set_rate and .determine_rate. |
795 | * .determine_rate. | ||
796 | */ | 793 | */ |
797 | unsigned long __clk_determine_rate(struct clk_hw *hw, | 794 | unsigned long __clk_determine_rate(struct clk_hw *hw, |
798 | unsigned long rate, | 795 | unsigned long rate, |
@@ -811,7 +808,7 @@ EXPORT_SYMBOL_GPL(__clk_determine_rate); | |||
811 | * @clk: round the rate of this clock | 808 | * @clk: round the rate of this clock |
812 | * @rate: the rate which is to be rounded | 809 | * @rate: the rate which is to be rounded |
813 | * | 810 | * |
814 | * Caller must hold prepare_lock. Useful for clk_ops such as .set_rate | 811 | * Useful for clk_ops such as .set_rate |
815 | */ | 812 | */ |
816 | unsigned long __clk_round_rate(struct clk *clk, unsigned long rate) | 813 | unsigned long __clk_round_rate(struct clk *clk, unsigned long rate) |
817 | { | 814 | { |
@@ -892,10 +889,8 @@ static int __clk_notify(struct clk_core *core, unsigned long msg, | |||
892 | * | 889 | * |
893 | * Walks the subtree of clks starting with clk and recalculates accuracies as | 890 | * Walks the subtree of clks starting with clk and recalculates accuracies as |
894 | * it goes. Note that if a clk does not implement the .recalc_accuracy | 891 | * it goes. Note that if a clk does not implement the .recalc_accuracy |
895 | * callback then it is assumed that the clock will take on the accuracy of it's | 892 | * callback then it is assumed that the clock will take on the accuracy of its |
896 | * parent. | 893 | * parent. |
897 | * | ||
898 | * Caller must hold prepare_lock. | ||
899 | */ | 894 | */ |
900 | static void __clk_recalc_accuracies(struct clk_core *core) | 895 | static void __clk_recalc_accuracies(struct clk_core *core) |
901 | { | 896 | { |
@@ -968,8 +963,6 @@ static unsigned long clk_recalc(struct clk_core *core, | |||
968 | * | 963 | * |
969 | * clk_recalc_rates also propagates the POST_RATE_CHANGE notification, | 964 | * clk_recalc_rates also propagates the POST_RATE_CHANGE notification, |
970 | * if necessary. | 965 | * if necessary. |
971 | * | ||
972 | * Caller must hold prepare_lock. | ||
973 | */ | 966 | */ |
974 | static void __clk_recalc_rates(struct clk_core *core, unsigned long msg) | 967 | static void __clk_recalc_rates(struct clk_core *core, unsigned long msg) |
975 | { | 968 | { |
@@ -1179,8 +1172,6 @@ static int __clk_set_parent(struct clk_core *core, struct clk_core *parent, | |||
1179 | * subtree have subscribed to the notifications. Note that if a clk does not | 1172 | * subtree have subscribed to the notifications. Note that if a clk does not |
1180 | * implement the .recalc_rate callback then it is assumed that the clock will | 1173 | * implement the .recalc_rate callback then it is assumed that the clock will |
1181 | * take on the rate of its parent. | 1174 | * take on the rate of its parent. |
1182 | * | ||
1183 | * Caller must hold prepare_lock. | ||
1184 | */ | 1175 | */ |
1185 | static int __clk_speculate_rates(struct clk_core *core, | 1176 | static int __clk_speculate_rates(struct clk_core *core, |
1186 | unsigned long parent_rate) | 1177 | unsigned long parent_rate) |
@@ -2091,11 +2082,11 @@ out: | |||
2091 | } | 2082 | } |
2092 | 2083 | ||
2093 | /** | 2084 | /** |
2094 | * clk_debug_register - add a clk node to the debugfs clk tree | 2085 | * clk_debug_register - add a clk node to the debugfs clk directory |
2095 | * @core: the clk being added to the debugfs clk tree | 2086 | * @core: the clk being added to the debugfs clk directory |
2096 | * | 2087 | * |
2097 | * Dynamically adds a clk to the debugfs clk tree if debugfs has been | 2088 | * Dynamically adds a clk to the debugfs clk directory if debugfs has been |
2098 | * initialized. Otherwise it bails out early since the debugfs clk tree | 2089 | * initialized. Otherwise it bails out early since the debugfs clk directory |
2099 | * will be created lazily by clk_debug_init as part of a late_initcall. | 2090 | * will be created lazily by clk_debug_init as part of a late_initcall. |
2100 | */ | 2091 | */ |
2101 | static int clk_debug_register(struct clk_core *core) | 2092 | static int clk_debug_register(struct clk_core *core) |
@@ -2116,11 +2107,11 @@ unlock: | |||
2116 | } | 2107 | } |
2117 | 2108 | ||
2118 | /** | 2109 | /** |
2119 | * clk_debug_unregister - remove a clk node from the debugfs clk tree | 2110 | * clk_debug_unregister - remove a clk node from the debugfs clk directory |
2120 | * @core: the clk being removed from the debugfs clk tree | 2111 | * @core: the clk being removed from the debugfs clk directory |
2121 | * | 2112 | * |
2122 | * Dynamically removes a clk and all it's children clk nodes from the | 2113 | * Dynamically removes a clk and all its child nodes from the |
2123 | * debugfs clk tree if clk->dentry points to debugfs created by | 2114 | * debugfs clk directory if clk->dentry points to debugfs created by |
2124 | * clk_debug_register in __clk_init. | 2115 | * clk_debug_register in __clk_init. |
2125 | */ | 2116 | */ |
2126 | static void clk_debug_unregister(struct clk_core *core) | 2117 | static void clk_debug_unregister(struct clk_core *core) |
@@ -2146,16 +2137,13 @@ struct dentry *clk_debugfs_add_file(struct clk_hw *hw, char *name, umode_t mode, | |||
2146 | EXPORT_SYMBOL_GPL(clk_debugfs_add_file); | 2137 | EXPORT_SYMBOL_GPL(clk_debugfs_add_file); |
2147 | 2138 | ||
2148 | /** | 2139 | /** |
2149 | * clk_debug_init - lazily create the debugfs clk tree visualization | 2140 | * clk_debug_init - lazily populate the debugfs clk directory |
2150 | * | 2141 | * |
2151 | * clks are often initialized very early during boot before memory can | 2142 | * clks are often initialized very early during boot before memory can be |
2152 | * be dynamically allocated and well before debugfs is setup. | 2143 | * dynamically allocated and well before debugfs is setup. This function |
2153 | * clk_debug_init walks the clk tree hierarchy while holding | 2144 | * populates the debugfs clk directory once at boot-time when we know that |
2154 | * prepare_lock and creates the topology as part of a late_initcall, | 2145 | * debugfs is setup. It should only be called once at boot-time, all other clks |
2155 | * thus insuring that clks initialized very early will still be | 2146 | * added dynamically will be done so with clk_debug_register. |
2156 | * represented in the debugfs clk tree. This function should only be | ||
2157 | * called once at boot-time, and all other clks added dynamically will | ||
2158 | * be done so with clk_debug_register. | ||
2159 | */ | 2147 | */ |
2160 | static int __init clk_debug_init(void) | 2148 | static int __init clk_debug_init(void) |
2161 | { | 2149 | { |
@@ -2512,10 +2500,7 @@ fail_out: | |||
2512 | } | 2500 | } |
2513 | EXPORT_SYMBOL_GPL(clk_register); | 2501 | EXPORT_SYMBOL_GPL(clk_register); |
2514 | 2502 | ||
2515 | /* | 2503 | /* Free memory allocated for a clock. */ |
2516 | * Free memory allocated for a clock. | ||
2517 | * Caller must hold prepare_lock. | ||
2518 | */ | ||
2519 | static void __clk_release(struct kref *ref) | 2504 | static void __clk_release(struct kref *ref) |
2520 | { | 2505 | { |
2521 | struct clk_core *core = container_of(ref, struct clk_core, ref); | 2506 | struct clk_core *core = container_of(ref, struct clk_core, ref); |