@@ -1093,9 +1093,12 @@ static int dpu_bind(struct device *dev, struct device *master, void *data)
return PTR_ERR(dpu_kms->opp_table);
/* OPP table is optional */
ret = dev_pm_opp_of_add_table(dev);
- if (ret && ret != -ENODEV) {
- dev_err(dev, "invalid OPP table in device tree\n");
- goto put_clkname;
+ if (ret) {
+ dev_pm_opp_put_clkname(dpu_kms->opp_table);
+ if (ret != -ENODEV) {
+ dev_err(dev, "invalid OPP table in device tree\n");
+ return ret;
+ }
}
mp = &dpu_kms->mp;
@@ -1122,7 +1125,6 @@ static int dpu_bind(struct device *dev, struct device *master, void *data)
return ret;
err:
dev_pm_opp_of_remove_table(dev);
-put_clkname:
dev_pm_opp_put_clkname(dpu_kms->opp_table);
return ret;
}
@@ -1891,10 +1891,12 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi)
return PTR_ERR(msm_host->opp_table);
/* OPP table is optional */
ret = dev_pm_opp_of_add_table(&pdev->dev);
- if (ret && ret != -ENODEV) {
- dev_err(&pdev->dev, "invalid OPP table in device tree\n");
+ if (ret) {
dev_pm_opp_put_clkname(msm_host->opp_table);
- return ret;
+ if (ret != -ENODEV) {
+ dev_err(&pdev->dev, "invalid OPP table in device tree\n");
+ return ret;
+ }
}
init_completion(&msm_host->dma_comp);
We should use dev_pm_opp_put_clkname() to free opp table each time dev_pm_opp_of_add_table() got error. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 10 ++++++---- drivers/gpu/drm/msm/dsi/dsi_host.c | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-)