summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2016-10-24 11:40:48 +0200
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:54:07 +0900
commit243f7d05260cb1f6dc7abf009f3004a0ebfd10ff (patch)
tree1af671e824047326116dce8cbfe5127f92e8f042
parentf74fff5a566848b758fe1dd843cf06d50c7dcaa8 (diff)
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. Change-Id: I2cbb12c54c43b10ebac76a00a5ef954c2ae627f6 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 96cd9e5e3c0d..91b7a305e75b 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -2150,19 +2150,15 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
return ret;
}
- hdata->reg_hdmi_en = devm_regulator_get(dev, "hdmi-en");
- if (IS_ERR(hdata->reg_hdmi_en) && PTR_ERR(hdata->reg_hdmi_en) != -ENOENT) {
- DRM_ERROR("failed to get hdmi-en regulator\n");
- return PTR_ERR(hdata->reg_hdmi_en);
- }
- if (!IS_ERR(hdata->reg_hdmi_en)) {
+ hdata->reg_hdmi_en = devm_regulator_get_optional(dev, "hdmi-en");
+ if (PTR_ERR(hdata->reg_hdmi_en) != -ENODEV) {
+ if (IS_ERR(hdata->reg_hdmi_en))
+ return PTR_ERR(hdata->reg_hdmi_en);
+
ret = regulator_enable(hdata->reg_hdmi_en);
- if (ret) {
+ if (ret)
DRM_ERROR("failed to enable hdmi-en regulator\n");
- return ret;
- }
- } else
- hdata->reg_hdmi_en = NULL;
+ }
return hdmi_bridge_init(hdata);
}
@@ -2417,7 +2413,7 @@ static int hdmi_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
- if (hdata->reg_hdmi_en)
+ if (!IS_ERR(hdata->reg_hdmi_en))
regulator_disable(hdata->reg_hdmi_en);
if (hdata->hdmiphy_port)