]> git.dujemihanovic.xyz Git - linux.git/commitdiff
clk: Constify clk_has_parent()
authorMaxime Ripard <maxime@cerno.tech>
Tue, 16 Aug 2022 11:25:25 +0000 (13:25 +0200)
committerStephen Boyd <sboyd@kernel.org>
Thu, 15 Sep 2022 16:32:06 +0000 (09:32 -0700)
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>
drivers/clk/clk.c
include/linux/clk.h

index 8e4a8b9aa3203378a87d3aeab6416818be0294aa..3b68a9b8234a0623a9fc332309dbc4fa3f1a7483 100644 (file)
@@ -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)
index c13061cabdfc904cb909002824479809fc014ffb..1ef0133242374bab763e97aed82c4ae58b1129ec 100644 (file)
@@ -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