mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
drm/panel: s6e63j0x03: 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, the error value gets printed. Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210916104627.11622-1-caihuoqing@baidu.com
This commit is contained in:
parent
d41af761db
commit
94f9b9525c
1 changed files with 8 additions and 13 deletions
|
@ -452,27 +452,22 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi)
|
|||
ctx->supplies[1].supply = "vci";
|
||||
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
|
||||
ctx->supplies);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "failed to get regulators: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
if (ret < 0)
|
||||
return dev_err_probe(dev, ret, "failed to get regulators\n");
|
||||
|
||||
ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
|
||||
if (IS_ERR(ctx->reset_gpio)) {
|
||||
dev_err(dev, "cannot get reset-gpio: %ld\n",
|
||||
PTR_ERR(ctx->reset_gpio));
|
||||
return PTR_ERR(ctx->reset_gpio);
|
||||
}
|
||||
if (IS_ERR(ctx->reset_gpio))
|
||||
return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
|
||||
"cannot get reset-gpio\n");
|
||||
|
||||
drm_panel_init(&ctx->panel, dev, &s6e63j0x03_funcs,
|
||||
DRM_MODE_CONNECTOR_DSI);
|
||||
|
||||
ctx->bl_dev = backlight_device_register("s6e63j0x03", dev, ctx,
|
||||
&s6e63j0x03_bl_ops, NULL);
|
||||
if (IS_ERR(ctx->bl_dev)) {
|
||||
dev_err(dev, "failed to register backlight device\n");
|
||||
return PTR_ERR(ctx->bl_dev);
|
||||
}
|
||||
if (IS_ERR(ctx->bl_dev))
|
||||
return dev_err_probe(dev, PTR_ERR(ctx->bl_dev),
|
||||
"failed to register backlight device\n");
|
||||
|
||||
ctx->bl_dev->props.max_brightness = MAX_BRIGHTNESS;
|
||||
ctx->bl_dev->props.brightness = DEFAULT_BRIGHTNESS;
|
||||
|
|
Loading…
Reference in a new issue