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>
This commit is contained in:

committed by
Mike Turquette

parent
7ce3e8ccba
commit
2ac6b1f50a
@@ -339,11 +339,11 @@ const char *__clk_get_name(struct clk *clk);
|
||||
struct clk_hw *__clk_get_hw(struct clk *clk);
|
||||
u8 __clk_get_num_parents(struct clk *clk);
|
||||
struct clk *__clk_get_parent(struct clk *clk);
|
||||
inline int __clk_get_enable_count(struct clk *clk);
|
||||
inline int __clk_get_prepare_count(struct clk *clk);
|
||||
inline unsigned int __clk_get_enable_count(struct clk *clk);
|
||||
inline unsigned int __clk_get_prepare_count(struct clk *clk);
|
||||
unsigned long __clk_get_rate(struct clk *clk);
|
||||
unsigned long __clk_get_flags(struct clk *clk);
|
||||
int __clk_is_enabled(struct clk *clk);
|
||||
bool __clk_is_enabled(struct clk *clk);
|
||||
struct clk *__clk_lookup(const char *name);
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user