diff options
author | Taniya Das <[email protected]> | 2020-01-06 15:48:42 +0530 |
---|---|---|
committer | Stephen Boyd <[email protected]> | 2020-01-06 08:53:44 -0800 |
commit | 924e2d0155608328c589f23b2f9942a4ed65438a (patch) | |
tree | 210c968ae09db5eab24725b43c9c38909ed5c13e | |
parent | 253dc75a0bb8f6207b3ac5f4897871b7b47a554e (diff) |
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: 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]>
-rw-r--r-- | drivers/clk/qcom/clk-rpmh.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c index 7ed313ad6e43..a12ce8da2d00 100644 --- a/drivers/clk/qcom/clk-rpmh.c +++ b/drivers/clk/qcom/clk-rpmh.c @@ -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) { |