[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210907062349.1879-1-caihuoqing@baidu.com>
Date: Tue, 7 Sep 2021 14:23:48 +0800
From: Cai Huoqing <caihuoqing@...du.com>
To: <caihuoqing@...du.com>
CC: Thierry Reding <thierry.reding@...il.com>,
Sam Ravnborg <sam@...nborg.org>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
<dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] drm: panel: tl070wsh30: Add a single error handling block at the end of the function.
A single error handling block at the end of the function could
be brought in to make code a little more concise.
Signed-off-by: Cai Huoqing <caihuoqing@...du.com>
---
drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
index 820731be7147..5e54ef4b3a9c 100644
--- a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
+++ b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
@@ -59,8 +59,7 @@ static int tdo_tl070wsh30_panel_prepare(struct drm_panel *panel)
err = mipi_dsi_dcs_exit_sleep_mode(tdo_tl070wsh30->link);
if (err < 0) {
dev_err(panel->dev, "failed to exit sleep mode: %d\n", err);
- regulator_disable(tdo_tl070wsh30->supply);
- return err;
+ goto err_disable_reg;
}
msleep(200);
@@ -68,8 +67,7 @@ static int tdo_tl070wsh30_panel_prepare(struct drm_panel *panel)
err = mipi_dsi_dcs_set_display_on(tdo_tl070wsh30->link);
if (err < 0) {
dev_err(panel->dev, "failed to set display on: %d\n", err);
- regulator_disable(tdo_tl070wsh30->supply);
- return err;
+ goto err_disable_reg;
}
msleep(20);
@@ -77,6 +75,9 @@ static int tdo_tl070wsh30_panel_prepare(struct drm_panel *panel)
tdo_tl070wsh30->prepared = true;
return 0;
+err_disable_reg:
+ regulator_disable(tdo_tl070wsh30->supply);
+ return err;
}
static int tdo_tl070wsh30_panel_unprepare(struct drm_panel *panel)
--
2.25.1
Powered by blists - more mailing lists