Commit acaf1b32 authored by Johan Hovold's avatar Johan Hovold Committed by Bjorn Andersson

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: 90114ca1 ("clk: qcom: add SM8550 DISPCC driver")
Cc: stable@vger.kernel.org      # 6.3
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230718132902.21430-4-johan+linaro@kernel.orgSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
parent b0f3d01b
...@@ -1761,8 +1761,10 @@ static int disp_cc_sm8550_probe(struct platform_device *pdev) ...@@ -1761,8 +1761,10 @@ static int disp_cc_sm8550_probe(struct platform_device *pdev)
return ret; return ret;
regmap = qcom_cc_map(pdev, &disp_cc_sm8550_desc); regmap = qcom_cc_map(pdev, &disp_cc_sm8550_desc);
if (IS_ERR(regmap)) if (IS_ERR(regmap)) {
return PTR_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_pll0, regmap, &disp_cc_pll0_config);
clk_lucid_evo_pll_configure(&disp_cc_pll1, regmap, &disp_cc_pll1_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) ...@@ -1777,9 +1779,16 @@ static int disp_cc_sm8550_probe(struct platform_device *pdev)
regmap_update_bits(regmap, 0xe054, BIT(0), BIT(0)); regmap_update_bits(regmap, 0xe054, BIT(0), BIT(0));
ret = qcom_cc_really_probe(pdev, &disp_cc_sm8550_desc, regmap); ret = qcom_cc_really_probe(pdev, &disp_cc_sm8550_desc, regmap);
if (ret)
goto err_put_rpm;
pm_runtime_put(&pdev->dev); pm_runtime_put(&pdev->dev);
return 0;
err_put_rpm:
pm_runtime_put_sync(&pdev->dev);
return ret; return ret;
} }
......
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