msm: mdss: Unregister the regulator notifier when mdss_mdp probe fails
Currently, when mdss_mdp probe fails after registering for regulator notifications, the regulator_unregister_notifier function is not called. Because of this, when the regulator has some state change now, the notification call fails. Change-Id: I2a41029aa145f88477701ab75a6e30883d2c4017 Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
This commit is contained in:
parent
b59e3ba92e
commit
b4f3bd79a3
2 changed files with 8 additions and 0 deletions
|
@ -263,6 +263,7 @@ struct mdss_data_type {
|
|||
u32 latency_buff_per;
|
||||
atomic_t active_intf_cnt;
|
||||
bool has_rot_dwnscale;
|
||||
bool regulator_notif_register;
|
||||
|
||||
u64 ab[MDSS_MAX_BUS_CLIENTS];
|
||||
u64 ib[MDSS_MAX_BUS_CLIENTS];
|
||||
|
|
|
@ -912,6 +912,8 @@ static int mdss_mdp_irq_clk_setup(struct mdss_data_type *mdata)
|
|||
mdata->gdsc_cb.priority = 5;
|
||||
if (regulator_register_notifier(mdata->fs, &(mdata->gdsc_cb)))
|
||||
pr_warn("GDSC notification registration failed!\n");
|
||||
else
|
||||
mdata->regulator_notif_register = true;
|
||||
|
||||
mdata->vdd_cx = devm_regulator_get(&mdata->pdev->dev,
|
||||
"vdd-cx");
|
||||
|
@ -1571,6 +1573,9 @@ static int mdss_mdp_probe(struct platform_device *pdev)
|
|||
mdss_res->mdss_util->mdp_probe_done = true;
|
||||
probe_done:
|
||||
if (IS_ERR_VALUE(rc)) {
|
||||
if (mdata->regulator_notif_register)
|
||||
regulator_unregister_notifier(mdata->fs,
|
||||
&(mdata->gdsc_cb));
|
||||
mdss_mdp_hw.ptr = NULL;
|
||||
mdss_mdp_pp_term(&pdev->dev);
|
||||
mutex_destroy(&mdata->reg_lock);
|
||||
|
@ -3186,6 +3191,8 @@ static int mdss_mdp_remove(struct platform_device *pdev)
|
|||
mdss_mdp_pp_term(&pdev->dev);
|
||||
mdss_mdp_bus_scale_unregister(mdata);
|
||||
mdss_debugfs_remove(mdata);
|
||||
if (mdata->regulator_notif_register)
|
||||
regulator_unregister_notifier(mdata->fs, &(mdata->gdsc_cb));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue