Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1265961pxb; Thu, 16 Sep 2021 03:47:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCthgw1YMZgYp3EgYVeaT00DkUTsuasAodi+jkqV3LIoo0i2EoqZybpR/Qzxp0PZFBiqY6 X-Received: by 2002:a92:ca07:: with SMTP id j7mr1121067ils.29.1631789270798; Thu, 16 Sep 2021 03:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631789270; cv=none; d=google.com; s=arc-20160816; b=OO25UIw+KKyNT29glOt+IXUdAhYW3/oy3bCe6JbFA4pNNapS75oa6+YBlCUHtyfQtr j3iend3UkRctq3a6nzgi+3vZZlG3pPsOBTKyxO3oAoNkDcUxyPkJ9ZugnSbNsuBpGEBb mEzeDpoFbg6Z15gCeuZqid+EXf3/AcaqBjSGYbgUs+79yZ0L8Rm2KktBL1SRIRaY+w1i NbLXM5Ux5MmRIb51B2v/3ho3UDichOaQRknxz7PLDtWZ3w8O6ygEi7QVaqGud5K0uiE/ JvoPHC1K5guqDoytmHsk7LVH+OQ7LqMAuzCrXZ4HQ5kBNhN9L3NAjGtzgPCOrHKLTMbz G6vQ== 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=D167w+jAkacvmpuqHyeDbHSIXJ9t2Ee8ZJTKb8pKLtk=; b=AH3VwcJkRVWp0id5UO3NodfCJXJUsBjXS0DRWKgmLx+s11ByCuOZfAUAVz10tf0otF 7HdUjF4RYPbIj6wLDgTd+DyQa13sndCWBmOTf8mGy5OD7h8xEKIUbnZBgITEzTkeKJHw ogUK02GTI4hRoQq//tMuMynGnibFlcPMNcrXgipAriwnhAk3NPVT+Ue7aANMk/nDbWEr AcNd711HyWzDecfeXEHebQX+8mZcxUpT2A4p3x4HEdlEkXXJyl586OU8AZLPHLbrGfLI vrLoKsDEXymmKzQ70eeDfv4m4Mu6WgpKtgSzmrH3fIX52LpTYEsIgdQDmhgf+NiZ/G9k KwtA== 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 20si2253759ioz.25.2021.09.16.03.47.39; Thu, 16 Sep 2021 03:47:50 -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 S236899AbhIPKsH (ORCPT + 99 others); Thu, 16 Sep 2021 06:48:07 -0400 Received: from mx24.baidu.com ([111.206.215.185]:54720 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236990AbhIPKsD (ORCPT ); Thu, 16 Sep 2021 06:48:03 -0400 Received: from BJHW-Mail-Ex07.internal.baidu.com (unknown [10.127.64.17]) by Forcepoint Email with ESMTPS id EF663F8DC708AEE05EA3; Thu, 16 Sep 2021 18:46:40 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex07.internal.baidu.com (10.127.64.17) 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 18:46:40 +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 18:46:40 +0800 From: Cai Huoqing To: CC: Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , , Subject: [PATCH] drm/panel: sofef00: Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 18:46:34 +0800 Message-ID: <20210916104635.11675-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-Ex31.internal.baidu.com (172.31.51.25) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex07_2021-09-16 18:46:40:911 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, the error value gets printed. Signed-off-by: Cai Huoqing --- drivers/gpu/drm/panel/panel-samsung-sofef00.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c index 8cb1853574bb..b5fe145bf72c 100644 --- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c +++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c @@ -270,18 +270,14 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi) } ctx->supply = devm_regulator_get(dev, "vddio"); - if (IS_ERR(ctx->supply)) { - ret = PTR_ERR(ctx->supply); - dev_err(dev, "Failed to get vddio regulator: %d\n", ret); - return ret; - } + if (IS_ERR(ctx->supply)) + return dev_err_probe(dev, PTR_ERR(ctx->supply), + "Failed to get vddio regulator\n"); ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(ctx->reset_gpio)) { - ret = PTR_ERR(ctx->reset_gpio); - dev_warn(dev, "Failed to get reset-gpios: %d\n", ret); - return ret; - } + if (IS_ERR(ctx->reset_gpio)) + return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), + "Failed to get reset-gpios\n"); ctx->dsi = dsi; mipi_dsi_set_drvdata(dsi, ctx); -- 2.25.1