mirror of
https://github.com/torvalds/linux.git
synced 2026-11-09 13:44:03 +01:00
crypto: starfive - handle clock enable failures
Return error from failed clock enable. starfive_cryp_probe ignores clk_prepare_enable return for hclk/ahb, then remove/error paths unconditionally clk_disable_unprepare both clocks. Check consecutive clk_prepare_enable(cryp->hclk)/cryp->ahb returns in starfive_cryp_probe. Signed-off-by: Jiawen Liu <1298662399@qq.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
97e5869514
commit
5358248961
|
|
@ -120,8 +120,15 @@ static int starfive_cryp_probe(struct platform_device *pdev)
|
|||
return dev_err_probe(&pdev->dev, PTR_ERR(cryp->rst),
|
||||
"Error getting hardware reset line\n");
|
||||
|
||||
clk_prepare_enable(cryp->hclk);
|
||||
clk_prepare_enable(cryp->ahb);
|
||||
ret = clk_prepare_enable(cryp->hclk);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = clk_prepare_enable(cryp->ahb);
|
||||
if (ret) {
|
||||
clk_disable_unprepare(cryp->hclk);
|
||||
return ret;
|
||||
}
|
||||
reset_control_deassert(cryp->rst);
|
||||
|
||||
spin_lock(&dev_list.lock);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user