diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-11-13 11:14:19 +0100 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2020-11-14 18:04:09 +0100 |
commit | e4accab4e0b069bd4ddc1ac769a77b989bb9ed1c (patch) | |
tree | 6df735465c3a6fb0f32db9727c6e6c6c2676a2da | |
parent | clk: qcom: Add support to LPASS AON_CC Glitch Free Mux clocks (diff) | |
download | linux-e4accab4e0b069bd4ddc1ac769a77b989bb9ed1c.tar.xz linux-e4accab4e0b069bd4ddc1ac769a77b989bb9ed1c.zip |
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: 4ee9fe3e292b ("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>
-rw-r--r-- | drivers/clk/qcom/lpasscorecc-sc7180.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/clk/qcom/lpasscorecc-sc7180.c b/drivers/clk/qcom/lpasscorecc-sc7180.c index 1a3925badd7c..9081649f476f 100644 --- a/drivers/clk/qcom/lpasscorecc-sc7180.c +++ b/drivers/clk/qcom/lpasscorecc-sc7180.c @@ -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); |