2021-09-16 07:39:15

by Cai,Huoqing

[permalink] [raw]
Subject: [PATCH] drm/stm: dsi: Improve use of dev_err_probe()

Return dev_err_probe() directly, because the return value of
dev_err_probe() is the appropriate error code, and it can
reduce code size, simplify the code.

Signed-off-by: Cai Huoqing <[email protected]>
---
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index 32cb41b2202f..6e9e42d069c9 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -370,11 +370,9 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
}

dsi->vdd_supply = devm_regulator_get(dev, "phy-dsi");
- if (IS_ERR(dsi->vdd_supply)) {
- ret = PTR_ERR(dsi->vdd_supply);
- dev_err_probe(dev, ret, "Failed to request regulator\n");
- return ret;
- }
+ if (IS_ERR(dsi->vdd_supply))
+ return dev_err_probe(dev, PTR_ERR(dsi->vdd_supply),
+ "Failed to request regulator\n");

ret = regulator_enable(dsi->vdd_supply);
if (ret) {
--
2.25.1