mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
clk: s2mps11: Propagate OF provider registration failures
s2mps11_clk_probe() ignores of_clk_add_hw_provider() failures, stores
driver data and returns success even though DT consumers cannot acquire the
registered clocks.
Return the provider error through the existing lookup cleanup path. Skip
empty lookup slots while unwinding because S2MPS14 omits its CP clock.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: b228fad50c ("clk: s2mps11: Migrate to clk_hw based OF and registration APIs")
Assisted-by: LLM
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
parent
061aca8aa0
commit
276741aac3
|
|
@ -192,8 +192,10 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
|
|||
clk_data->hws[i] = &s2mps11_clks[i].hw;
|
||||
}
|
||||
|
||||
of_clk_add_hw_provider(s2mps11_clks->clk_np, of_clk_hw_onecell_get,
|
||||
clk_data);
|
||||
ret = of_clk_add_hw_provider(s2mps11_clks->clk_np,
|
||||
of_clk_hw_onecell_get, clk_data);
|
||||
if (ret)
|
||||
goto err_reg;
|
||||
|
||||
platform_set_drvdata(pdev, s2mps11_clks);
|
||||
|
||||
|
|
@ -201,8 +203,10 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
|
|||
|
||||
err_reg:
|
||||
of_node_put(s2mps11_clks[0].clk_np);
|
||||
while (--i >= 0)
|
||||
clkdev_drop(s2mps11_clks[i].lookup);
|
||||
while (--i >= 0) {
|
||||
if (s2mps11_clks[i].lookup)
|
||||
clkdev_drop(s2mps11_clks[i].lookup);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user