Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 498d5a37 authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Inki Dae
Browse files

drm/exynos/hdmi: use optional regulator_get for hdmi-en



hdmi-en is an optional regulator so it should be better handled by
devm_regulator_get_optional call.

Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 2445c4a4
Loading
Loading
Loading
Loading
+11 −13
Original line number Original line Diff line number Diff line
@@ -1803,19 +1803,17 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
	}
	}
	res->regul_count = ARRAY_SIZE(supply);
	res->regul_count = ARRAY_SIZE(supply);


	res->reg_hdmi_en = devm_regulator_get(dev, "hdmi-en");
	res->reg_hdmi_en = devm_regulator_get_optional(dev, "hdmi-en");
	if (IS_ERR(res->reg_hdmi_en) && PTR_ERR(res->reg_hdmi_en) != -ENOENT) {

		DRM_ERROR("failed to get hdmi-en regulator\n");
	if (PTR_ERR(res->reg_hdmi_en) == -ENODEV)
		return 0;

	if (IS_ERR(res->reg_hdmi_en))
		return PTR_ERR(res->reg_hdmi_en);
		return PTR_ERR(res->reg_hdmi_en);
	}

	if (!IS_ERR(res->reg_hdmi_en)) {
	ret = regulator_enable(res->reg_hdmi_en);
	ret = regulator_enable(res->reg_hdmi_en);
		if (ret) {
	if (ret)
		DRM_ERROR("failed to enable hdmi-en regulator\n");
		DRM_ERROR("failed to enable hdmi-en regulator\n");
			return ret;
		}
	} else
		res->reg_hdmi_en = NULL;


	return ret;
	return ret;
fail:
fail:
@@ -2050,7 +2048,7 @@ static int hdmi_remove(struct platform_device *pdev)


	pm_runtime_disable(&pdev->dev);
	pm_runtime_disable(&pdev->dev);


	if (hdata->res.reg_hdmi_en)
	if (!IS_ERR(hdata->res.reg_hdmi_en))
		regulator_disable(hdata->res.reg_hdmi_en);
		regulator_disable(hdata->res.reg_hdmi_en);


	if (hdata->hdmiphy_port)
	if (hdata->hdmiphy_port)