Commit 6400a8e8 authored by Viresh Kumar's avatar Viresh Kumar Committed by Rob Clark

drm/msm: Unconditionally call dev_pm_opp_of_remove_table()

dev_pm_opp_of_remove_table() doesn't report any errors when it fails to
find the OPP table with error -ENODEV (i.e. OPP table not present for
the device). And we can call dev_pm_opp_of_remove_table()
unconditionally here.

While at it, also create a label to put clkname.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 363bcec9
...@@ -1093,12 +1093,9 @@ static int dpu_bind(struct device *dev, struct device *master, void *data) ...@@ -1093,12 +1093,9 @@ static int dpu_bind(struct device *dev, struct device *master, void *data)
return PTR_ERR(dpu_kms->opp_table); return PTR_ERR(dpu_kms->opp_table);
/* OPP table is optional */ /* OPP table is optional */
ret = dev_pm_opp_of_add_table(dev); ret = dev_pm_opp_of_add_table(dev);
if (!ret) { if (ret && ret != -ENODEV) {
dpu_kms->has_opp_table = true;
} else if (ret != -ENODEV) {
dev_err(dev, "invalid OPP table in device tree\n"); dev_err(dev, "invalid OPP table in device tree\n");
dev_pm_opp_put_clkname(dpu_kms->opp_table); goto put_clkname;
return ret;
} }
mp = &dpu_kms->mp; mp = &dpu_kms->mp;
...@@ -1124,8 +1121,8 @@ static int dpu_bind(struct device *dev, struct device *master, void *data) ...@@ -1124,8 +1121,8 @@ static int dpu_bind(struct device *dev, struct device *master, void *data)
priv->kms = &dpu_kms->base; priv->kms = &dpu_kms->base;
return ret; return ret;
err: err:
if (dpu_kms->has_opp_table) dev_pm_opp_of_remove_table(dev);
dev_pm_opp_of_remove_table(dev); put_clkname:
dev_pm_opp_put_clkname(dpu_kms->opp_table); dev_pm_opp_put_clkname(dpu_kms->opp_table);
return ret; return ret;
} }
...@@ -1143,8 +1140,7 @@ static void dpu_unbind(struct device *dev, struct device *master, void *data) ...@@ -1143,8 +1140,7 @@ static void dpu_unbind(struct device *dev, struct device *master, void *data)
if (dpu_kms->rpm_enabled) if (dpu_kms->rpm_enabled)
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
if (dpu_kms->has_opp_table) dev_pm_opp_of_remove_table(dev);
dev_pm_opp_of_remove_table(dev);
dev_pm_opp_put_clkname(dpu_kms->opp_table); dev_pm_opp_put_clkname(dpu_kms->opp_table);
} }
......
...@@ -131,7 +131,6 @@ struct dpu_kms { ...@@ -131,7 +131,6 @@ struct dpu_kms {
bool rpm_enabled; bool rpm_enabled;
struct opp_table *opp_table; struct opp_table *opp_table;
bool has_opp_table;
struct dss_module_power mp; struct dss_module_power mp;
......
...@@ -113,7 +113,6 @@ struct msm_dsi_host { ...@@ -113,7 +113,6 @@ struct msm_dsi_host {
struct clk *byte_intf_clk; struct clk *byte_intf_clk;
struct opp_table *opp_table; struct opp_table *opp_table;
bool has_opp_table;
u32 byte_clk_rate; u32 byte_clk_rate;
u32 pixel_clk_rate; u32 pixel_clk_rate;
...@@ -1891,9 +1890,7 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) ...@@ -1891,9 +1890,7 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi)
return PTR_ERR(msm_host->opp_table); return PTR_ERR(msm_host->opp_table);
/* OPP table is optional */ /* OPP table is optional */
ret = dev_pm_opp_of_add_table(&pdev->dev); ret = dev_pm_opp_of_add_table(&pdev->dev);
if (!ret) { if (ret && ret != -ENODEV) {
msm_host->has_opp_table = true;
} else if (ret != -ENODEV) {
dev_err(&pdev->dev, "invalid OPP table in device tree\n"); dev_err(&pdev->dev, "invalid OPP table in device tree\n");
dev_pm_opp_put_clkname(msm_host->opp_table); dev_pm_opp_put_clkname(msm_host->opp_table);
return ret; return ret;
...@@ -1934,8 +1931,7 @@ void msm_dsi_host_destroy(struct mipi_dsi_host *host) ...@@ -1934,8 +1931,7 @@ void msm_dsi_host_destroy(struct mipi_dsi_host *host)
mutex_destroy(&msm_host->cmd_mutex); mutex_destroy(&msm_host->cmd_mutex);
mutex_destroy(&msm_host->dev_mutex); mutex_destroy(&msm_host->dev_mutex);
if (msm_host->has_opp_table) dev_pm_opp_of_remove_table(&msm_host->pdev->dev);
dev_pm_opp_of_remove_table(&msm_host->pdev->dev);
dev_pm_opp_put_clkname(msm_host->opp_table); dev_pm_opp_put_clkname(msm_host->opp_table);
pm_runtime_disable(&msm_host->pdev->dev); pm_runtime_disable(&msm_host->pdev->dev);
} }
......
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