[PATCH 08/10] drm/panel: rm68200: Use dev_err_probe() to simplify code
Yuan Can
yuancan at huawei.com
Sat Sep 24 01:56:14 UTC 2022
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 at huawei.com>
---
drivers/gpu/drm/panel/panel-raydium-rm68200.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c b/drivers/gpu/drm/panel/panel-raydium-rm68200.c
index 5f9b340588fb..20c9dc49e012 100644
--- a/drivers/gpu/drm/panel/panel-raydium-rm68200.c
+++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c
@@ -377,12 +377,9 @@ static int rm68200_probe(struct mipi_dsi_device *dsi)
}
ctx->supply = devm_regulator_get(dev, "power");
- if (IS_ERR(ctx->supply)) {
- ret = PTR_ERR(ctx->supply);
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "cannot get regulator: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(ctx->supply))
+ return dev_err_probe(dev, PTR_ERR(ctx->supply),
+ "cannot get regulator\n");
mipi_dsi_set_drvdata(dsi, ctx);
--
2.17.1
More information about the dri-devel
mailing list