Switch _qcom_cc_register_board_clk() to use parent_hws. Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> --- Changes since v1: - Properly fix the clock's parent data in case parent clock is present in the dtsi. --- drivers/clk/qcom/common.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c index 75f09e6e057e..9f2bd37c9540 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c @@ -133,7 +133,7 @@ static int _qcom_cc_register_board_clk(struct device *dev, const char *path, struct device_node *node = NULL; struct device_node *clocks_node; struct clk_fixed_factor *factor; - struct clk_fixed_rate *fixed; + struct clk_fixed_rate *fixed = NULL; struct clk_init_data init_data = { }; int ret; @@ -161,6 +161,8 @@ static int _qcom_cc_register_board_clk(struct device *dev, const char *path, of_node_put(node); if (add_factor) { + struct clk_parent_data parent_data; + factor = devm_kzalloc(dev, sizeof(*factor), GFP_KERNEL); if (!factor) return -EINVAL; @@ -168,8 +170,13 @@ static int _qcom_cc_register_board_clk(struct device *dev, const char *path, factor->mult = factor->div = 1; factor->hw.init = &init_data; + if (fixed) + parent_data.hw = &fixed->hw; + else + parent_data.name = path; + init_data.name = name; - init_data.parent_names = &path; + init_data.parent_data = &parent_data; init_data.num_parents = 1; init_data.flags = 0; init_data.ops = &clk_fixed_factor_ops; -- 2.39.0