clk: qcom: Make common clk_hw registrations
Several clock controller drivers define a list of clk_hw devices, and then register those devices in probe() before using common code to process the rest of initialization. Extend the common code to accept a list of clk_hw devices to process, thus eliminating many duplicate implementations. Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org> Suggested-by: Stephen Boyd <sboyd@kernel.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Tested-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:

committed by
Stephen Boyd

parent
6131dc8121
commit
760be6586f
@@ -2959,6 +2959,10 @@ static const struct regmap_config gcc_msm8998_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct clk_hw *gcc_msm8998_hws[] = {
|
||||
&xo.hw,
|
||||
};
|
||||
|
||||
static const struct qcom_cc_desc gcc_msm8998_desc = {
|
||||
.config = &gcc_msm8998_regmap_config,
|
||||
.clks = gcc_msm8998_clocks,
|
||||
@@ -2967,6 +2971,8 @@ static const struct qcom_cc_desc gcc_msm8998_desc = {
|
||||
.num_resets = ARRAY_SIZE(gcc_msm8998_resets),
|
||||
.gdscs = gcc_msm8998_gdscs,
|
||||
.num_gdscs = ARRAY_SIZE(gcc_msm8998_gdscs),
|
||||
.clk_hws = gcc_msm8998_hws,
|
||||
.num_clk_hws = ARRAY_SIZE(gcc_msm8998_hws),
|
||||
};
|
||||
|
||||
static int gcc_msm8998_probe(struct platform_device *pdev)
|
||||
@@ -2986,10 +2992,6 @@ static int gcc_msm8998_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = devm_clk_hw_register(&pdev->dev, &xo.hw);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return qcom_cc_really_probe(pdev, &gcc_msm8998_desc, regmap);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user