Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of: clk: Make of_clk_get_parent_{count,name}() parameter const

of_clk_get_parent_count() and of_clk_get_parent_name() never modify the
device nodes passed, so they can be const.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lkml.kernel.org/r/20200212094317.1150-1-geert+renesas@glider.be
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Geert Uytterhoeven and committed by
Stephen Boyd
4a4472fd bb6d3fb3

+6 -6
+2 -2
drivers/clk/clk.c
··· 4713 4713 * 4714 4714 * Returns: The number of clocks that are possible parents of this node 4715 4715 */ 4716 - unsigned int of_clk_get_parent_count(struct device_node *np) 4716 + unsigned int of_clk_get_parent_count(const struct device_node *np) 4717 4717 { 4718 4718 int count; 4719 4719 ··· 4725 4725 } 4726 4726 EXPORT_SYMBOL_GPL(of_clk_get_parent_count); 4727 4727 4728 - const char *of_clk_get_parent_name(struct device_node *np, int index) 4728 + const char *of_clk_get_parent_name(const struct device_node *np, int index) 4729 4729 { 4730 4730 struct of_phandle_args clkspec; 4731 4731 struct property *prop;
+4 -4
include/linux/of_clk.h
··· 11 11 12 12 #if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF) 13 13 14 - unsigned int of_clk_get_parent_count(struct device_node *np); 15 - const char *of_clk_get_parent_name(struct device_node *np, int index); 14 + unsigned int of_clk_get_parent_count(const struct device_node *np); 15 + const char *of_clk_get_parent_name(const struct device_node *np, int index); 16 16 void of_clk_init(const struct of_device_id *matches); 17 17 18 18 #else /* !CONFIG_COMMON_CLK || !CONFIG_OF */ 19 19 20 - static inline unsigned int of_clk_get_parent_count(struct device_node *np) 20 + static inline unsigned int of_clk_get_parent_count(const struct device_node *np) 21 21 { 22 22 return 0; 23 23 } 24 - static inline const char *of_clk_get_parent_name(struct device_node *np, 24 + static inline const char *of_clk_get_parent_name(const struct device_node *np, 25 25 int index) 26 26 { 27 27 return NULL;