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:
Huaibin Yang 2013-01-10 17:27:23 -08:00 committed by Stephen Boyd
parent 1797ef4a79
commit 99842e9189

View file

@ -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;
}