Commit 924e2d01 authored by Taniya Das's avatar Taniya Das Committed by Stephen Boyd

clk: qcom: rpmh: skip undefined clocks when registering

When iterating over a platform's available clocks in clk_rpmh_probe(),
check for undefined (null) entries in the clocks array.  Not all
clock indexes necessarily have clocks defined.
Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
Link: https://lkml.kernel.org/r/1578305923-29125-2-git-send-email-tdas@codeaurora.org
[sboyd@kernel.org: Leave 'name' declaration at beginning of loop]
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 253dc75a
......@@ -431,11 +431,16 @@ static int clk_rpmh_probe(struct platform_device *pdev)
hw_clks = desc->clks;
for (i = 0; i < desc->num_clks; i++) {
const char *name = hw_clks[i]->init->name;
const char *name;
u32 res_addr;
size_t aux_data_len;
const struct bcm_db *data;
if (!hw_clks[i])
continue;
name = hw_clks[i]->init->name;
rpmh_clk = to_clk_rpmh(hw_clks[i]);
res_addr = cmd_db_read_addr(rpmh_clk->res_name);
if (!res_addr) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment