Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1157653pxb; Thu, 16 Sep 2021 00:39:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzQkbBIkhk4eEvHvRDAmkfCXHHgdsT8a0z2dAdSNOCdmBHNoDhyYmxEy6rmNtng8s/2/1Z X-Received: by 2002:a05:6e02:1aa2:: with SMTP id l2mr1014786ilv.179.1631777955293; Thu, 16 Sep 2021 00:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631777955; cv=none; d=google.com; s=arc-20160816; b=ZRtO09O8P2SVIif0SZGswXDrYWIhY9YB735i5Dq1jWrfzqVqyw6WjlnF8RbZQ/JqMh x+JiFx5ENxQaw/ukMlNbFzmP/lZI+UO/zu/LJ4QukEnLZ8zObhR7RwAt46hMXruXc//E NbSHdtdm9s/JhpFlcAqGeCfDWAXfnEKzYgAlSLxbEBV2nHb7Ox278FyO2oCaQ0SoPxPw r/epkMrv5R7oYYNCUmGvFurkKMlsa3us9g7CM8PL4806mXKOcBqDFtg885tbeXlmoUW4 wFZUfJQoIVQISIx0Kr3cp76aUOrEplSOT8hBGhmRXHM0c75LDXH/QpBLdltr+XDxAQHt N7pw== 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=yyPwZPF2c10LOCetO/DzZYshe71uwZFnNmEBSPa3OkE=; b=xeVdxeqVQiyvIrlVSUM0fHMdo8EKeJUd6UN2n+WbpXi8vqVeNdyoltSyekmTdK+7Uv 2C5zW6kXb5sPc4WqbM8QsCqvkM/42EpPc9lTEcNodWS9UkpBcrKpikmvcaT0GB17+Lx2 vDMsoVL3qO+saKKN2nQLimehz6yTG3KWHl3IGL60qWo9r0ecAzexoO0CCnKxhlzNiM5q U9/2JBqaUSv/F9WfYOYfzEM01m9qGxwusODOgNPyCld57WPKDOHVgz19wSYlPsyPgGDd 6PLllFaetgITyLFoCD3Qd0t5rrhRfzkVHM8pP8ZvB991lNsnis80DxUHZWFMipw3YKLO 9O6Q== 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 w18si1994484ilc.63.2021.09.16.00.39.04; Thu, 16 Sep 2021 00:39:15 -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 S234874AbhIPHin (ORCPT + 99 others); Thu, 16 Sep 2021 03:38:43 -0400 Received: from mx22.baidu.com ([220.181.50.185]:43804 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234863AbhIPHim (ORCPT ); Thu, 16 Sep 2021 03:38:42 -0400 Received: from BC-Mail-Ex03.internal.baidu.com (unknown [172.31.51.43]) by Forcepoint Email with ESMTPS id 3F30E44C953BCB3ABA48; Thu, 16 Sep 2021 15:37:20 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex03.internal.baidu.com (172.31.51.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Thu, 16 Sep 2021 15:37:19 +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; Thu, 16 Sep 2021 15:37:19 +0800 From: Cai Huoqing To: CC: Yannick Fertre , Philippe Cornu , Benjamin Gaignard , David Airlie , "Daniel Vetter" , Maxime Coquelin , Alexandre Torgue , , , , Subject: [PATCH] drm/stm: dsi: Improve use of dev_err_probe() Date: Thu, 16 Sep 2021 15:37:13 +0800 Message-ID: <20210916073714.9057-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-EX04.internal.baidu.com (172.31.51.44) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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