diff options
author | Ahmad Fatoum <ahmad@a3f.at> | 2022-01-14 07:59:53 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-01-14 09:25:44 +0100 |
commit | 6cff559fcac61263c3619e39230332680330e00c (patch) | |
tree | 32b933bae8ce760150cf355b2b9678e7fb77b64c /include | |
parent | 593225ef6807024d3cfecb02186242aeaf5df966 (diff) | |
download | barebox-6cff559fcac61263c3619e39230332680330e00c.tar.gz barebox-6cff559fcac61263c3619e39230332680330e00c.tar.xz |
clk: propagate error pointers in clk_hw_to_clk and clk_to_clk_hw
This will make porting helpers easier, because it's harder to miss
error checking.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Link: https://lore.barebox.org/20220114065953.698483-2-ahmad@a3f.at
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/clk.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h index 481c288712..ffc1ac8489 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -432,12 +432,12 @@ struct clk_hw { static inline struct clk *clk_hw_to_clk(struct clk_hw *hw) { - return &hw->clk; + return IS_ERR(hw) ? ERR_CAST(hw) : &hw->clk; } static inline struct clk_hw *clk_to_clk_hw(struct clk *clk) { - return container_of(clk, struct clk_hw, clk); + return IS_ERR(clk) ? ERR_CAST(clk) : container_of(clk, struct clk_hw, clk); } struct clk_div_table { |