diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2015-09-25 15:48:21 +0300 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2015-10-26 09:09:43 +0300 |
commit | 498d5a373ac4aa20d7ad63770f2196922ae2f26c (patch) | |
tree | 8278472924aa5043aaceb892c3192c9a7b7e3056 /drivers/gpu/drm/exynos/exynos_hdmi.c | |
parent | 2445c4a44f200a3137dbaaa3603f2f095c9fdd45 (diff) | |
download | linux-498d5a373ac4aa20d7ad63770f2196922ae2f26c.tar.xz |
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: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_hdmi.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 725ddb58a624..841470ca7c77 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1803,19 +1803,17 @@ static int hdmi_resources_init(struct hdmi_context *hdata) } res->regul_count = ARRAY_SIZE(supply); - res->reg_hdmi_en = devm_regulator_get(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"); + res->reg_hdmi_en = devm_regulator_get_optional(dev, "hdmi-en"); + + if (PTR_ERR(res->reg_hdmi_en) == -ENODEV) + return 0; + + if (IS_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); - if (ret) { - DRM_ERROR("failed to enable hdmi-en regulator\n"); - return ret; - } - } else - res->reg_hdmi_en = NULL; + + ret = regulator_enable(res->reg_hdmi_en); + if (ret) + DRM_ERROR("failed to enable hdmi-en regulator\n"); return ret; fail: @@ -2050,7 +2048,7 @@ static int hdmi_remove(struct platform_device *pdev) 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); if (hdata->hdmiphy_port) |