clk: change clk_get_num_parents into clk_hw_get_num_parents
Subsystems (3)
PATCH 1/2 clk: change clk_get_num_parents into clk_hw_get_num_parents
There is no clk_get_num_parents in Linux, but clk_hw_get_num_parents. Our only users uses it with a clk_hw, so adjust the function accordingly.
Signed-off-by Ahmad Fatoum <[email protected]>
--- drivers/clk/at91/clk-generated.c | 2 +- include/linux/clk.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/clk/at91/clk-generated.c +1 -1
@@ -92,7 +92,7 @@ static int clk_generated_set_parent(struct clk_hw *hw, u8 index) {struct clk_generated *gck =to_clk_generated (hw); -if (index >=clk_get_num_parents (clk_hw_to_clk (hw))) +if (index >=clk_hw_get_num_parents (hw))return -EINVAL ; gck->parent_id = index;
include/linux/clk.h +2 -2
@@ -721,9 +721,9 @@ int of_clk_add_provider(struct device_node *np, void *data), void *data); -static inline unsigned int clk_get_num_parents (const struct clk *hw) +static inline unsigned int clk_hw_get_num_parents (const struct clk_hw *hw) { -return hw->num_parents; +return hw->clk.num_parents; }#else
Signature · 7 lines
2.33.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/2 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 <[email protected]>
--- include/linux/clk.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/clk.h +2 -2
@@ -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 {
Signature · 7 lines
2.33.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 9 lines · Ahmad Fatoum
There is no
clk_get_num_parentsin Linux, butclk_hw_get_num_parents. Our only users uses it with aclk_hw, so adjust the function accordingly.Signed-off-by Ahmad Fatoum <[email protected]>--- drivers/clk/at91/clk-generated.c | 2 +- include/linux/clk.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Applied, thanks
Sascha
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox