Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1264503pxb; Thu, 16 Sep 2021 03:45:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPIahVRDMQTRQZXRvAfLqrMYWVNb7N2/FMxz0Wug5UXlAGWijh7zX86W8kIQM5DnBdUsT7 X-Received: by 2002:a05:6e02:1111:: with SMTP id u17mr3380175ilk.262.1631789109170; Thu, 16 Sep 2021 03:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631789109; cv=none; d=google.com; s=arc-20160816; b=FTriDEMQ4iTJuk+0LxoY7vmoCbW83ODU1+W87IHdsu06KJwi9IizlUp2h713rAJPl/ Aiq/aaqXMAQO53rgRz5qKvl+EPiUv1J/cM8eP5ujWBaVcgvSVWl7Om/yRrl9T+YESgH7 OaM/1OykkPda7BBAg5Z26hrU8qxrftA0MBJriLiUC1ldKO5F6H9/IqWP2ZyjHVSP8kej TXypIoKVWOtw/l6AEa7BGuD5yzuV5ScJLJ3HnaVK5f5xxSRNvT9NPnV1rzP5gFU4EXX3 ot6ALjwXccZhD0g//swZpgC+KGKXteSOIqAk6uQ4LcoC/uoWEC4W65x78m0gY6C7ueIL ZCJw== 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=GiXmJR/+Lbkjv0e6HZE+CyMcOWYPIO2wsB12bA8t7U0=; b=tztwIRU63RjS+A5xUMJHjRC+OCV6oya8EMUzmJxCdLBlmrPzEoD49NIF444hNx7dLJ BQ+M3dsc061M7nErKpSuSTKhP60nky+ue1VrbyfKICsZ4mwhyU65QS3J9gVy6okN1ynt yWwphGliMsU40v7T3ehG+ZeIDOGH8G+WKBmA9fTXnu98K7s4r6MiwdYXCY9E0SPhp4x+ vgaMc9Q7QPlzZy/Tz7+94fBmk/TrFtfTIYrCDBh3w2lpqjcHyyiKjvaobWtylvDs50NO UfpZ9yUshBt6pGHXF166ulGP2VGUB9Uiy0wf08yfcWC6nGJcaubIQd/rM2Jiuv/heJuc WeGQ== 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 r4si2561028ilb.106.2021.09.16.03.44.56; Thu, 16 Sep 2021 03:45:09 -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 S236827AbhIPKoP (ORCPT + 99 others); Thu, 16 Sep 2021 06:44:15 -0400 Received: from mx22.baidu.com ([220.181.50.185]:50722 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237040AbhIPKoP (ORCPT ); Thu, 16 Sep 2021 06:44:15 -0400 Received: from BC-Mail-Ex22.internal.baidu.com (unknown [172.31.51.16]) by Forcepoint Email with ESMTPS id 8D4F57F9998EC7D6044A; Thu, 16 Sep 2021 18:42:53 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex22.internal.baidu.com (172.31.51.16) 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 18:42:53 +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:42:52 +0800 From: Cai Huoqing To: CC: Icenowy Zheng , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , , Subject: [PATCH] drm/panel: k101-im2ba02: Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 18:42:47 +0800 Message-ID: <20210916104247.11270-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-Ex15.internal.baidu.com (172.31.51.55) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) 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, and the error value gets printed. Signed-off-by: Cai Huoqing --- drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c b/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c index 2a602aee61c3..cb0bb3076099 100644 --- a/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c +++ b/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c @@ -456,16 +456,13 @@ static int k101_im2ba02_dsi_probe(struct mipi_dsi_device *dsi) ret = devm_regulator_bulk_get(&dsi->dev, ARRAY_SIZE(ctx->supplies), ctx->supplies); - if (ret < 0) { - dev_err(&dsi->dev, "Couldn't get regulators\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(&dsi->dev, ret, "Couldn't get regulators\n"); ctx->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); - if (IS_ERR(ctx->reset)) { - dev_err(&dsi->dev, "Couldn't get our reset GPIO\n"); - return PTR_ERR(ctx->reset); - } + if (IS_ERR(ctx->reset)) + return dev_err_probe(&dsi->dev, PTR_ERR(ctx->reset), + "Couldn't get our reset GPIO\n"); drm_panel_init(&ctx->panel, &dsi->dev, &k101_im2ba02_funcs, DRM_MODE_CONNECTOR_DSI); -- 2.25.1