diff options
-rw-r--r-- | drivers/clk/clk.c | 16 | ||||
-rw-r--r-- | include/linux/clk-provider.h | 2 |
2 files changed, 15 insertions, 3 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index b775c88ac36d..fb74dc1f7520 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c | |||
@@ -2986,9 +2986,21 @@ struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec) | |||
2986 | } | 2986 | } |
2987 | EXPORT_SYMBOL_GPL(of_clk_get_from_provider); | 2987 | EXPORT_SYMBOL_GPL(of_clk_get_from_provider); |
2988 | 2988 | ||
2989 | int of_clk_get_parent_count(struct device_node *np) | 2989 | /** |
2990 | * of_clk_get_parent_count() - Count the number of clocks a device node has | ||
2991 | * @np: device node to count | ||
2992 | * | ||
2993 | * Returns: The number of clocks that are possible parents of this node | ||
2994 | */ | ||
2995 | unsigned int of_clk_get_parent_count(struct device_node *np) | ||
2990 | { | 2996 | { |
2991 | return of_count_phandle_with_args(np, "clocks", "#clock-cells"); | 2997 | int count; |
2998 | |||
2999 | count = of_count_phandle_with_args(np, "clocks", "#clock-cells"); | ||
3000 | if (count < 0) | ||
3001 | return 0; | ||
3002 | |||
3003 | return count; | ||
2992 | } | 3004 | } |
2993 | EXPORT_SYMBOL_GPL(of_clk_get_parent_count); | 3005 | EXPORT_SYMBOL_GPL(of_clk_get_parent_count); |
2994 | 3006 | ||
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index fce7f027f8a7..da95258127aa 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
@@ -716,7 +716,7 @@ void of_clk_del_provider(struct device_node *np); | |||
716 | struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, | 716 | struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, |
717 | void *data); | 717 | void *data); |
718 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); | 718 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); |
719 | int of_clk_get_parent_count(struct device_node *np); | 719 | unsigned int of_clk_get_parent_count(struct device_node *np); |
720 | int of_clk_parent_fill(struct device_node *np, const char **parents, | 720 | int of_clk_parent_fill(struct device_node *np, const char **parents, |
721 | unsigned int size); | 721 | unsigned int size); |
722 | const char *of_clk_get_parent_name(struct device_node *np, int index); | 722 | const char *of_clk_get_parent_name(struct device_node *np, int index); |