mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
msm_fb: display: check bus scale handler for registration
mdp bus client could be registered multiple times without the check. Change-Id: I582741c75e815873357e62bc9bf0ff61a4cecf9f Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
This commit is contained in:
parent
1797ef4a79
commit
99842e9189
1 changed files with 13 additions and 5 deletions
|
@ -2405,11 +2405,15 @@ static int mdp_bus_scale_register(void)
|
|||
mdp_bus_usecases[i].num_paths = 1;
|
||||
mdp_bus_usecases[i].vectors = &mdp_bus_vectors[i];
|
||||
}
|
||||
mdp_bus_scale_handle = msm_bus_scale_register_client(bus_pdata);
|
||||
|
||||
if (!mdp_bus_scale_handle) {
|
||||
pr_err("%s: not able to get bus scale!\n", __func__);
|
||||
return -ENOMEM;
|
||||
mdp_bus_scale_handle = msm_bus_scale_register_client(bus_pdata);
|
||||
if (!mdp_bus_scale_handle) {
|
||||
pr_err("%s: not able to get bus scale!\n", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3024,8 +3028,10 @@ static int mdp_probe(struct platform_device *pdev)
|
|||
mdp_probe_err:
|
||||
platform_device_put(msm_fb_dev);
|
||||
#ifdef CONFIG_MSM_BUS_SCALING
|
||||
if (mdp_bus_scale_handle > 0)
|
||||
if (mdp_bus_scale_handle > 0) {
|
||||
msm_bus_scale_unregister_client(mdp_bus_scale_handle);
|
||||
mdp_bus_scale_handle = 0;
|
||||
}
|
||||
#endif
|
||||
return rc;
|
||||
}
|
||||
|
@ -3121,8 +3127,10 @@ static int mdp_remove(struct platform_device *pdev)
|
|||
iounmap(msm_mdp_base);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
#ifdef CONFIG_MSM_BUS_SCALING
|
||||
if (mdp_bus_scale_handle > 0)
|
||||
if (mdp_bus_scale_handle > 0) {
|
||||
msm_bus_scale_unregister_client(mdp_bus_scale_handle);
|
||||
mdp_bus_scale_handle = 0;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue