Commit ae654683 authored by David Heidelberg's avatar David Heidelberg Committed by Neil Armstrong

drm/panel: JDI LT070ME05000 simplify with dev_err_probe()

Use the dev_err_probe() helper to simplify error handling during probe.
This also handle scenario, when EDEFER is returned and useless error is printed.

Fixes error:
panel-jdi-lt070me05000 4700000.dsi.0: cannot get enable-gpio -517
Signed-off-by: default avatarDavid Heidelberg <david@ixit.cz>
Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230812185239.378582-1-david@ixit.cz
parent 07dd476f
...@@ -404,38 +404,30 @@ static int jdi_panel_add(struct jdi_panel *jdi) ...@@ -404,38 +404,30 @@ static int jdi_panel_add(struct jdi_panel *jdi)
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(jdi->supplies), ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(jdi->supplies),
jdi->supplies); jdi->supplies);
if (ret < 0) { if (ret < 0)
dev_err(dev, "failed to init regulator, ret=%d\n", ret); return dev_err_probe(dev, ret,
return ret; "failed to init regulator, ret=%d\n", ret);
}
jdi->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); jdi->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
if (IS_ERR(jdi->enable_gpio)) { if (IS_ERR(jdi->enable_gpio)) {
ret = PTR_ERR(jdi->enable_gpio); return dev_err_probe(dev, PTR_ERR(jdi->enable_gpio),
dev_err(dev, "cannot get enable-gpio %d\n", ret); "cannot get enable-gpio %d\n", ret);
return ret;
} }
jdi->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); jdi->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(jdi->reset_gpio)) { if (IS_ERR(jdi->reset_gpio))
ret = PTR_ERR(jdi->reset_gpio); return dev_err_probe(dev, PTR_ERR(jdi->reset_gpio),
dev_err(dev, "cannot get reset-gpios %d\n", ret); "cannot get reset-gpios %d\n", ret);
return ret;
}
jdi->dcdc_en_gpio = devm_gpiod_get(dev, "dcdc-en", GPIOD_OUT_LOW); jdi->dcdc_en_gpio = devm_gpiod_get(dev, "dcdc-en", GPIOD_OUT_LOW);
if (IS_ERR(jdi->dcdc_en_gpio)) { if (IS_ERR(jdi->dcdc_en_gpio))
ret = PTR_ERR(jdi->dcdc_en_gpio); return dev_err_probe(dev, PTR_ERR(jdi->dcdc_en_gpio),
dev_err(dev, "cannot get dcdc-en-gpio %d\n", ret); "cannot get dcdc-en-gpio %d\n", ret);
return ret;
}
jdi->backlight = drm_panel_create_dsi_backlight(jdi->dsi); jdi->backlight = drm_panel_create_dsi_backlight(jdi->dsi);
if (IS_ERR(jdi->backlight)) { if (IS_ERR(jdi->backlight))
ret = PTR_ERR(jdi->backlight); return dev_err_probe(dev, PTR_ERR(jdi->backlight),
dev_err(dev, "failed to register backlight %d\n", ret); "failed to register backlight %d\n", ret);
return ret;
}
drm_panel_init(&jdi->base, &jdi->dsi->dev, &jdi_panel_funcs, drm_panel_init(&jdi->base, &jdi->dsi->dev, &jdi_panel_funcs,
DRM_MODE_CONNECTOR_DSI); DRM_MODE_CONNECTOR_DSI);
......
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