diff options
author | Johan Hovold <[email protected]> | 2023-07-18 15:28:57 +0200 |
---|---|---|
committer | Bjorn Andersson <[email protected]> | 2023-07-18 07:58:49 -0700 |
commit | acaf1b3296a504d4a61b685f78baae771421608d (patch) | |
tree | 665ac797ba93de2494c1c575da931d58ddf1ba7f | |
parent | b0f3d01bda6c3f6f811e70f76d2040ae81f64565 (diff) |
clk: qcom: dispcc-sm8550: fix runtime PM imbalance on probe errors
Make sure to decrement the runtime PM usage count before returning in
case regmap initialisation fails.
Fixes: 90114ca11476 ("clk: qcom: add SM8550 DISPCC driver")
Cc: [email protected] # 6.3
Cc: Neil Armstrong <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bjorn Andersson <[email protected]>
-rw-r--r-- | drivers/clk/qcom/dispcc-sm8550.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/clk/qcom/dispcc-sm8550.c b/drivers/clk/qcom/dispcc-sm8550.c index 1e5a11081860..b2fae9001ff2 100644 --- a/drivers/clk/qcom/dispcc-sm8550.c +++ b/drivers/clk/qcom/dispcc-sm8550.c @@ -1761,8 +1761,10 @@ static int disp_cc_sm8550_probe(struct platform_device *pdev) return ret; regmap = qcom_cc_map(pdev, &disp_cc_sm8550_desc); - if (IS_ERR(regmap)) - return PTR_ERR(regmap); + if (IS_ERR(regmap)) { + ret = PTR_ERR(regmap); + goto err_put_rpm; + } clk_lucid_evo_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config); clk_lucid_evo_pll_configure(&disp_cc_pll1, regmap, &disp_cc_pll1_config); @@ -1777,9 +1779,16 @@ static int disp_cc_sm8550_probe(struct platform_device *pdev) regmap_update_bits(regmap, 0xe054, BIT(0), BIT(0)); ret = qcom_cc_really_probe(pdev, &disp_cc_sm8550_desc, regmap); + if (ret) + goto err_put_rpm; pm_runtime_put(&pdev->dev); + return 0; + +err_put_rpm: + pm_runtime_put_sync(&pdev->dev); + return ret; } |