PM / devfreq: rockchip_dmc: Fix support for optional regulators

When not using the "_optional" function, a dummy regulator may be returned
and the driver fails to set voltage.

Change-Id: Ib636572362ece234d6b5694c8832ec01daa274e1
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
Finley Xiao
2017-09-18 17:58:04 +08:00
committed by Huang, Tao
parent 4c0c4b768e
commit 4a57a86932

View File

@@ -1533,7 +1533,7 @@ static int rockchip_dmcfreq_probe(struct platform_device *pdev)
mutex_init(&data->lock);
INIT_LIST_HEAD(&data->video_info_list);
data->vdd_center = devm_regulator_get(dev, "center");
data->vdd_center = devm_regulator_get_optional(dev, "center");
if (IS_ERR(data->vdd_center)) {
dev_err(dev, "Cannot get the regulator \"center\"\n");
return PTR_ERR(data->vdd_center);