Skip to content

Commit 22fb0e2

Browse files
mripardbebarino
authored andcommitted
clk: Constify clk_has_parent()
clk_has_parent() doesn't modify the clocks being passed, so let's make it const. Suggested-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://lore.kernel.org/r/20220816112530.1837489-21-maxime@cerno.tech Tested-by: Linux Kernel Functional Testing <lkft@linaro.org> Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 1234a2c commit 22fb0e2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/clk/clk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2593,7 +2593,7 @@ void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent)
25932593
*
25942594
* Returns true if @parent is a possible parent for @clk, false otherwise.
25952595
*/
2596-
bool clk_has_parent(struct clk *clk, struct clk *parent)
2596+
bool clk_has_parent(const struct clk *clk, const struct clk *parent)
25972597
{
25982598
/* NULL clocks should be nops, so return success if either is NULL. */
25992599
if (!clk || !parent)

include/linux/clk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ int clk_set_rate_exclusive(struct clk *clk, unsigned long rate);
799799
*
800800
* Returns true if @parent is a possible parent for @clk, false otherwise.
801801
*/
802-
bool clk_has_parent(struct clk *clk, struct clk *parent);
802+
bool clk_has_parent(const struct clk *clk, const struct clk *parent);
803803

804804
/**
805805
* clk_set_rate_range - set a rate range for a clock source

0 commit comments

Comments
 (0)