aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/clk-provider.h
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2012-10-04 02:38:55 -0400
committerMike Turquette <mturquette@linaro.org>2012-10-29 14:05:03 -0400
commit2ac6b1f50a397580b8dc28f2833e54af7926fc71 (patch)
treed9fbe4f63392d462b41296b9407ec622d9212823 /include/linux/clk-provider.h
parent7ce3e8ccbac708229ba8c40c9c2a43ca7fcdb3ae (diff)
clk: Don't return negative numbers for unsigned values with !clk
Some of the helper functions return negative error codes if passed a NULL clock. This can lead to confusing behavior when the expected return value is unsigned. Fix up these accessors so that they return unsigned values (or bool in the case of is_enabled). This way we can't interpret NULL clocks as having valid and interesting values. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'include/linux/clk-provider.h')
-rw-r--r--include/linux/clk-provider.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index e1d83b187df2..0dce3d31eae5 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -339,11 +339,11 @@ const char *__clk_get_name(struct clk *clk);
339struct clk_hw *__clk_get_hw(struct clk *clk); 339struct clk_hw *__clk_get_hw(struct clk *clk);
340u8 __clk_get_num_parents(struct clk *clk); 340u8 __clk_get_num_parents(struct clk *clk);
341struct clk *__clk_get_parent(struct clk *clk); 341struct clk *__clk_get_parent(struct clk *clk);
342inline int __clk_get_enable_count(struct clk *clk); 342inline unsigned int __clk_get_enable_count(struct clk *clk);
343inline int __clk_get_prepare_count(struct clk *clk); 343inline unsigned int __clk_get_prepare_count(struct clk *clk);
344unsigned long __clk_get_rate(struct clk *clk); 344unsigned long __clk_get_rate(struct clk *clk);
345unsigned long __clk_get_flags(struct clk *clk); 345unsigned long __clk_get_flags(struct clk *clk);
346int __clk_is_enabled(struct clk *clk); 346bool __clk_is_enabled(struct clk *clk);
347struct clk *__clk_lookup(const char *name); 347struct clk *__clk_lookup(const char *name);
348 348
349/* 349/*