Commit e82ef424 authored by Cai Huoqing's avatar Cai Huoqing Committed by Sam Ravnborg

drm/panel: xpp055c272: 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: default avatarCai Huoqing <caihuoqing@baidu.com>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210916104650.11781-1-caihuoqing@baidu.com
parent a8daf03f
...@@ -283,26 +283,19 @@ static int xpp055c272_probe(struct mipi_dsi_device *dsi) ...@@ -283,26 +283,19 @@ static int xpp055c272_probe(struct mipi_dsi_device *dsi)
return -ENOMEM; return -ENOMEM;
ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(ctx->reset_gpio)) { if (IS_ERR(ctx->reset_gpio))
dev_err(dev, "cannot get reset gpio\n"); return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
return PTR_ERR(ctx->reset_gpio); "cannot get reset gpio\n");
}
ctx->vci = devm_regulator_get(dev, "vci"); ctx->vci = devm_regulator_get(dev, "vci");
if (IS_ERR(ctx->vci)) { if (IS_ERR(ctx->vci))
ret = PTR_ERR(ctx->vci); return dev_err_probe(dev, PTR_ERR(ctx->vci),
if (ret != -EPROBE_DEFER) "Failed to request vci regulator\n");
dev_err(dev, "Failed to request vci regulator: %d\n", ret);
return ret;
}
ctx->iovcc = devm_regulator_get(dev, "iovcc"); ctx->iovcc = devm_regulator_get(dev, "iovcc");
if (IS_ERR(ctx->iovcc)) { if (IS_ERR(ctx->iovcc))
ret = PTR_ERR(ctx->iovcc); return dev_err_probe(dev, PTR_ERR(ctx->iovcc),
if (ret != -EPROBE_DEFER) "Failed to request iovcc regulator\n");
dev_err(dev, "Failed to request iovcc regulator: %d\n", ret);
return ret;
}
mipi_dsi_set_drvdata(dsi, ctx); mipi_dsi_set_drvdata(dsi, ctx);
......
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