Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3495319pxb; Tue, 7 Sep 2021 00:22:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxysqx4YWcipanLWdQc0x75Kq9qlnS7BGtbLsjLwov1x32C9qVdCQTJpHoTXSLvA+cqj49H X-Received: by 2002:a05:6e02:198d:: with SMTP id g13mr11094942ilf.319.1630999261528; Tue, 07 Sep 2021 00:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630999261; cv=none; d=google.com; s=arc-20160816; b=fLnkGBLZZKBACu21R8m7bRTuI2hS7AJ1cQaM5ZpPy4A2T3xLGS9mwSGpdOEJxMzZuM Jt42iI6bpAmIAHFYmHjc95GgGQ0kBs5Ipo2oO8zqG3V3UhLySXZQFnT8rIB0sENQmqtA WjJbc8X3bOcqEhEyt/7i4RIadQO4ox8ZSbduwVOKxJhGikCxMPrI3UhtPmPPT+Zi+jOz sz0hzAoNMA2i+PDtz7MRcNSG8uK0ct3Ai17O0Pk3Op9fxTjgBS+gSiag4Mp5YQJwrafP vBLPWrJAq+AArng8qgbs/4fwRAAqvjSS5XTLOg1lrzxtQXEgHDYDx07jDAx9bNYShZj6 ErGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=xo5iX83poE24nyX9XDHlEPidrmUe9syNkMIx1wj2vvU=; b=gI3RGl82jW0un25EG0eVVasfELZ0X2VpfQIVjVWrkB1xR+evhgggN3Xv/Mf6OtRHbU EB0SSYXTQ6sybVBfckNz2fUREDxpTqSj9EXl75Vv+c3EfzTSGLLJyZH6ZJ8Wt2gAaoap 86zq6PeTh9HfyXgxg14C+W6xvI3P7R23/tuaJ5JfTh2IQT+Wkkpbe9vQ41UTQIpggKqv 1MwYkPm0FqEXJBtQ/yB2AUHvOFTUKn4O1tFYiEYqtY/s8kI/A/VYr8vYATNkPXehmty+ ESLP2/UZlTmVpsC8VRsGfXN43MwYgHoWH9MRaZEpqcAAGlUDSbfrMOvrskYjsydfyV4c K1OA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si9744681ilh.21.2021.09.07.00.20.50; Tue, 07 Sep 2021 00:21:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232140AbhIGG0K (ORCPT + 99 others); Tue, 7 Sep 2021 02:26:10 -0400 Received: from mx21.baidu.com ([220.181.3.85]:54148 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232523AbhIGGZD (ORCPT ); Tue, 7 Sep 2021 02:25:03 -0400 Received: from BJHW-Mail-Ex09.internal.baidu.com (unknown [10.127.64.32]) by Forcepoint Email with ESMTPS id CAB4E2C3067860A9672F; Tue, 7 Sep 2021 14:23:55 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex09.internal.baidu.com (10.127.64.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 7 Sep 2021 14:23:55 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 7 Sep 2021 14:23:55 +0800 From: Cai Huoqing To: CC: Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , , Subject: [PATCH] drm: panel: tl070wsh30: Add a single error handling block at the end of the function. Date: Tue, 7 Sep 2021 14:23:48 +0800 Message-ID: <20210907062349.1879-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex30.internal.baidu.com (172.31.51.24) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex09_2021-09-07 14:23:55:818 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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