Skip to content

Commit

Permalink
clk: Constify clk_has_parent()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mripard authored and bebarino committed Sep 15, 2022
1 parent 1234a2c commit 22fb0e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2593,7 +2593,7 @@ void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent)
*
* Returns true if @parent is a possible parent for @clk, false otherwise.
*/
bool clk_has_parent(struct clk *clk, struct clk *parent)
bool clk_has_parent(const struct clk *clk, const struct clk *parent)
{
/* NULL clocks should be nops, so return success if either is NULL. */
if (!clk || !parent)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/clk.h
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ int clk_set_rate_exclusive(struct clk *clk, unsigned long rate);
*
* Returns true if @parent is a possible parent for @clk, false otherwise.
*/
bool clk_has_parent(struct clk *clk, struct clk *parent);
bool clk_has_parent(const struct clk *clk, const struct clk *parent);

/**
* clk_set_rate_range - set a rate range for a clock source
Expand Down

0 comments on commit 22fb0e2

Please sign in to comment.