clk: qcom: Fix error checking for devm_clk_hw_get_clk()
Subsystems (3)
PATCH v2 1/1 clk: qcom: Fix error checking for devm_clk_hw_get_clk()
The devm_clk_hw_get_clk() function returns error pointers. It never returns NULL. Update the check accordingly.
Signed-off-by Yan Zhen <[email protected]>
---
Changes in v2:
- Return PTR_ERR(icd[i].clk) instead of -ENOENT.
drivers/clk/qcom/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/common.c +2 -2
@@ -273,8 +273,8 @@ static int qcom_cc_icc_register(struct device *dev, icd[i].slave_id = desc->icc_hws[i].slave_id; hws = &desc->clks[desc->icc_hws[i].clk_id]->hw; icd[i].clk =devm_clk_hw_get_clk (dev, hws,"icc" ); -if (!icd[i].clk) -return dev_err_probe (dev, -ENOENT , +if (IS_ERR (icd[i].clk)) +return dev_err_probe (dev,PTR_ERR (icd[i].clk),"(%d) clock entry is null\n" , i); icd[i].name =clk_hw_get_name (hws); }
Signature · 1 line
2.34.1
Quoted 2 lines
The
devm_clk_hw_get_clk()function returns error pointers. It never returns NULL. Update the check accordingly.
Would you like to add any tags (like “Fixes” and “Cc”)?
Regards,
Markus
Quoted 10 lines · Yan Zhen
The
devm_clk_hw_get_clk()function returns error pointers. It never returns NULL. Update the check accordingly.Signed-off-by Yan Zhen <[email protected]>---
Changes in v2:
- ReturnPTR_ERR(icd[i].clk)instead of-ENOENT.
Fixes 8737ec830ee3 ("clk: qcom: common: Add interconnect clocks support")
Reviewed-by Dmitry Baryshkov <[email protected]>
Signature · 2 lines
With best wishes Dmitry