[PATCH 16/24] clk: accept const arguments in clk_to_clk_hw/clk_hw_to_clk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Driver code may want to pass const pointers into these
functions. Change the implementation to support this.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 include/linux/clk.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/clk.h b/include/linux/clk.h
index 9bee20465247..9396e01003e1 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 {
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux