@@ -257,20 +257,14 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi)
}
ctx->vdd = devm_regulator_get(dev, "vdd");
- if (IS_ERR(ctx->vdd)) {
- ret = PTR_ERR(ctx->vdd);
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "Failed to request vdd regulator: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(ctx->vdd))
+ return dev_err_probe(dev, PTR_ERR(ctx->vdd),
+ "Failed to request vdd regulator\n");
ctx->iovcc = devm_regulator_get(dev, "iovcc");
- if (IS_ERR(ctx->iovcc)) {
- ret = PTR_ERR(ctx->iovcc);
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "Failed to request iovcc regulator: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(ctx->iovcc))
+ return dev_err_probe(dev, PTR_ERR(ctx->iovcc),
+ "Failed to request iovcc regulator\n");
ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
if (ret < 0) {
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can <yuancan@huawei.com> --- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)