Commit a0d60537 authored by Maxime Ripard's avatar Maxime Ripard

drm/panel: lvds: Handle the optional regulator case properly

The devm_regulator_get_optional function, unlike it was assumed in the
commit a1c55bcc ("drm/panel: lvds: Add support for the power-supply
property"), is actually returning an error pointer with -ENODEV instead of
NULL when there's no regulator to find.

Make sure we handle that case properly.
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fixes: a1c55bcc ("drm/panel: lvds: Add support for the power-supply property")
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180110155941.16109-1-maxime.ripard@free-electrons.com
parent 86a3ae58
...@@ -215,10 +215,17 @@ static int panel_lvds_probe(struct platform_device *pdev) ...@@ -215,10 +215,17 @@ static int panel_lvds_probe(struct platform_device *pdev)
lvds->supply = devm_regulator_get_optional(lvds->dev, "power"); lvds->supply = devm_regulator_get_optional(lvds->dev, "power");
if (IS_ERR(lvds->supply)) { if (IS_ERR(lvds->supply)) {
ret = PTR_ERR(lvds->supply); ret = PTR_ERR(lvds->supply);
dev_err(lvds->dev, "failed to request regulator: %d\n", ret);
if (ret != -ENODEV) {
if (ret != -EPROBE_DEFER)
dev_err(lvds->dev, "failed to request regulator: %d\n",
ret);
return ret; return ret;
} }
lvds->supply = NULL;
}
/* Get GPIOs and backlight controller. */ /* Get GPIOs and backlight controller. */
lvds->enable_gpio = devm_gpiod_get_optional(lvds->dev, "enable", lvds->enable_gpio = devm_gpiod_get_optional(lvds->dev, "enable",
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
......
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