Commit 6b1a69bc authored by Cai Huoqing's avatar Cai Huoqing Committed by Sam Ravnborg

drm/panel: ej030na: Make use of the helper function dev_err_probe()

When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
And using dev_err_probe() can reduce code size, and the error value
gets printed.
Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210916104225.11111-1-caihuoqing@baidu.com
parent 7f44a116
...@@ -198,16 +198,14 @@ static int ej030na_probe(struct spi_device *spi) ...@@ -198,16 +198,14 @@ static int ej030na_probe(struct spi_device *spi)
return -EINVAL; return -EINVAL;
priv->supply = devm_regulator_get(dev, "power"); priv->supply = devm_regulator_get(dev, "power");
if (IS_ERR(priv->supply)) { if (IS_ERR(priv->supply))
dev_err(dev, "Failed to get power supply\n"); return dev_err_probe(dev, PTR_ERR(priv->supply),
return PTR_ERR(priv->supply); "Failed to get power supply\n");
}
priv->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); priv->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(priv->reset_gpio)) { if (IS_ERR(priv->reset_gpio))
dev_err(dev, "Failed to get reset GPIO\n"); return dev_err_probe(dev, PTR_ERR(priv->reset_gpio),
return PTR_ERR(priv->reset_gpio); "Failed to get reset GPIO\n");
}
drm_panel_init(&priv->panel, dev, &ej030na_funcs, drm_panel_init(&priv->panel, dev, &ej030na_funcs,
DRM_MODE_CONNECTOR_DPI); DRM_MODE_CONNECTOR_DPI);
......
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