summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-02-20 13:47:28 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-02-23 11:15:44 +0100
commit203d97c81e9c9a2f5bcc268d9399899a306cb722 (patch)
tree8b2b60bf9015e9ed92d49757918d6bbd9482bd09 /include
parent8e10c0db3e97b5f004130d35339fc1dffa82fd5d (diff)
downloadbarebox-203d97c81e9c9a2f5bcc268d9399899a306cb722.tar.gz
barebox-203d97c81e9c9a2f5bcc268d9399899a306cb722.tar.xz
clk: accept const arguments in clk_to_clk_hw/clk_hw_to_clk
Driver code may want to pass const pointers into these functions. Change the implementation to support this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220220124736.3052502-17-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/clk.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 9bee204652..9396e01003 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -431,14 +431,14 @@ struct clk_hw {
const struct clk_init_data *init;
};
-static inline struct clk *clk_hw_to_clk(struct clk_hw *hw)
+static inline struct clk *clk_hw_to_clk(const struct clk_hw *hw)
{
- return IS_ERR(hw) ? ERR_CAST(hw) : &hw->clk;
+ return IS_ERR(hw) ? ERR_CAST(hw) : (struct clk *)&hw->clk;
}
-static inline struct clk_hw *clk_to_clk_hw(struct clk *clk)
+static inline struct clk_hw *clk_to_clk_hw(const struct clk *clk)
{
- return IS_ERR(clk) ? ERR_CAST(clk) : container_of(clk, struct clk_hw, clk);
+ return IS_ERR(clk) ? ERR_CAST(clk) : (struct clk_hw *)container_of(clk, struct clk_hw, clk);
}
struct clk_div_table {