]> git.baikalelectronics.ru Git - kernel.git/commit
clk: Make of_clk_get_parent_count() return unsigned ints
authorStephen Boyd <sboyd@codeaurora.org>
Fri, 19 Feb 2016 23:52:32 +0000 (15:52 -0800)
committerStephen Boyd <sboyd@codeaurora.org>
Sat, 27 Feb 2016 00:01:32 +0000 (16:01 -0800)
commitfb496b4dfc01d2c8abede975950fecf0d7f7463b
tree26fec721d11ac4766e5ed44f79ed6ab74fccdeaf
parent6a4dd986793eb7e6bddf17ad764ff009d54f3a70
clk: Make of_clk_get_parent_count() return unsigned ints

Russell King recently pointed out a bug in the clk-gpio code
where it fails to register the clk if of_clk_get_parent_count()
returns an error because the "clocks" property isn't present in
the DT node. If we're trying to count parents from DT we'd like
to know the count, not if there is a "clocks" property or not.
Furthermore, some drivers are assigning the return value to their
clk_init_data::num_parents member which is unsigned, leading to
potentially large numbers of parents when the property isn't
present.

Let's change the API to return an unsigned int instead of an int.
All the callers just want to know the count anyway, and this
avoids the bug that was in the clk-gpio driver.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/clk.c
include/linux/clk-provider.h