Commit e4accab4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Stephen Boyd

clk: qcom: lpass-sc7180: Clean up on error in lpass_sc7180_init()

Clean up the first driver if the second driver can't be registered.

Fixes: 4ee9fe3e ("clk: qcom: lpass-sc7180: Disentangle the two clock devices")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20201113101419.GC168908@mwandaReviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 794aa56a
......@@ -491,7 +491,13 @@ static int __init lpass_sc7180_init(void)
if (ret)
return ret;
return platform_driver_register(&lpass_hm_sc7180_driver);
ret = platform_driver_register(&lpass_hm_sc7180_driver);
if (ret) {
platform_driver_unregister(&lpass_core_cc_sc7180_driver);
return ret;
}
return 0;
}
subsys_initcall(lpass_sc7180_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment