Skip to content

Commit

Permalink
clk: qcom: lpass-sc7180: Clean up on error in lpass_sc7180_init()
Browse files Browse the repository at this point in the history
Clean up the first driver if the second driver can't be registered.

Fixes: 4ee9fe3 ("clk: qcom: lpass-sc7180: Disentangle the two clock devices")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20201113101419.GC168908@mwanda
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Dan Carpenter authored and Stephen Boyd committed Nov 14, 2020
1 parent 794aa56 commit e4accab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/clk/qcom/lpasscorecc-sc7180.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e4accab

Please sign in to comment.