Commit 4178bd5a authored by Biju Das's avatar Biju Das Committed by Sam Ravnborg

drm/bridge: lvds-codec: Use dev_err_probe for error handling

dev_err_probe function simplifies error handling. So use the same in probe
function wherever possible.
Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020093655.3584-1-biju.das.jz@bp.renesas.com
parent 281edb9f
...@@ -80,7 +80,6 @@ static int lvds_codec_probe(struct platform_device *pdev) ...@@ -80,7 +80,6 @@ static int lvds_codec_probe(struct platform_device *pdev)
struct device_node *panel_node; struct device_node *panel_node;
struct drm_panel *panel; struct drm_panel *panel;
struct lvds_codec *lvds_codec; struct lvds_codec *lvds_codec;
int ret;
lvds_codec = devm_kzalloc(dev, sizeof(*lvds_codec), GFP_KERNEL); lvds_codec = devm_kzalloc(dev, sizeof(*lvds_codec), GFP_KERNEL);
if (!lvds_codec) if (!lvds_codec)
...@@ -90,13 +89,9 @@ static int lvds_codec_probe(struct platform_device *pdev) ...@@ -90,13 +89,9 @@ static int lvds_codec_probe(struct platform_device *pdev)
lvds_codec->connector_type = (uintptr_t)of_device_get_match_data(dev); lvds_codec->connector_type = (uintptr_t)of_device_get_match_data(dev);
lvds_codec->vcc = devm_regulator_get(lvds_codec->dev, "power"); lvds_codec->vcc = devm_regulator_get(lvds_codec->dev, "power");
if (IS_ERR(lvds_codec->vcc)) { if (IS_ERR(lvds_codec->vcc))
ret = PTR_ERR(lvds_codec->vcc); return dev_err_probe(dev, PTR_ERR(lvds_codec->vcc),
if (ret != -EPROBE_DEFER) "Unable to get \"vcc\" supply\n");
dev_err(lvds_codec->dev,
"Unable to get \"vcc\" supply: %d\n", ret);
return ret;
}
lvds_codec->powerdown_gpio = devm_gpiod_get_optional(dev, "powerdown", lvds_codec->powerdown_gpio = devm_gpiod_get_optional(dev, "powerdown",
GPIOD_OUT_HIGH); GPIOD_OUT_HIGH);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment