Skip to content

Commit

Permalink
clk: qcom: rpmh: skip undefined clocks when registering
Browse files Browse the repository at this point in the history
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: Taniya Das <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
[[email protected]: Leave 'name' declaration at beginning of loop]
Signed-off-by: Stephen Boyd <[email protected]>
  • Loading branch information
Taniya Das authored and bebarino committed Jan 6, 2020
1 parent 253dc75 commit 924e2d0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/clk/qcom/clk-rpmh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 924e2d0

Please sign in to comment.