Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2204337pxb; Fri, 17 Sep 2021 04:50:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTvAA8W8bKArxF1sVVWYBJK+BBL+JRpmZtKByjdryfSd6gLITKe8xBsIxZJ51rjfuTWMEt X-Received: by 2002:a05:6602:214f:: with SMTP id y15mr1124048ioy.127.1631879433706; Fri, 17 Sep 2021 04:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631879433; cv=none; d=google.com; s=arc-20160816; b=zlUotUXt1DR6xA7MgJpI1SX2ksp9bRm/GYRl/sjBT5H3F4WS6okOByGFMHIbmmUEhq boUep2M93spqt1p8Td3eMlbDGHAPyCc4uDlQ4FOSp/WicniW8fIr+jOIz8nbQBF6sW3A K3v7iQHSSgJ1ITTQ8xo53u/SePZ9N3As20m5pk2x3hlpZhksLdoVo5f6cRIhgLW5sQdp wuY5O7PeK+Owt9VVPdAJCtlSYKUbEwaqHAxexVsniwGhg9MUQOKjwKHJLl0pjDXWro2e pbPcZEVPSCApk5kl5giZkAJKTU/0vUj//pG3dkxbbWjhU3/l+E3JAInEBXh2d9IzGyBC ZdOg== 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=riDXaLPUpRDjHarCsxK1YLHgPUJuQJjd6f+qKKMzZEw=; b=MZliJarCSMrfscWDQXwIi2LBq9R49phW8frE3j4BAnoGci+dyHlSus+SQDr/BIkKzO aHUnfXAG7MoAgV378bFI56rv9kiYbu9ROxV3+Wp/RZEx7ais25jH6BkoqptMAcivGWll lmIAGC10xkvNuKbJaAPEHJotP0OZeb/q25QL3a27syhivjHEhNjFGakBaBem29uzuLIW r2WCXN5A9qhEEWXuzHJkSfFUSrNXJ6GMPInJ6m6+wy8FhqhKlFw6hbgrwHCBmjajqzpl OTxqSk8wRlhBuzsZqgu4ibWcfEqyuWGNUQud10+9ju9AMNLM8SuZzFTd4MKAChMiNrRj cv5Q== 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 g1si5247020jab.92.2021.09.17.04.50.22; Fri, 17 Sep 2021 04:50:33 -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 S234705AbhIQCJL (ORCPT + 99 others); Thu, 16 Sep 2021 22:09:11 -0400 Received: from mx22.baidu.com ([220.181.50.185]:41554 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S242651AbhIQCJL (ORCPT ); Thu, 16 Sep 2021 22:09:11 -0400 Received: from BC-Mail-Ex12.internal.baidu.com (unknown [172.31.51.52]) by Forcepoint Email with ESMTPS id 0D4B134AA735FED9982D; Fri, 17 Sep 2021 10:07:48 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex12.internal.baidu.com (172.31.51.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Fri, 17 Sep 2021 10:07:47 +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; Fri, 17 Sep 2021 10:07:47 +0800 From: Cai Huoqing To: CC: Thierry Reding , David Airlie , Daniel Vetter , Jonathan Hunter , , , Subject: [PATCH v2] drm/tegra: sor: Make use of the helper function dev_err_probe() Date: Fri, 17 Sep 2021 10:07:41 +0800 Message-ID: <20210917020741.17525-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: BJHW-Mail-Ex16.internal.baidu.com (10.127.64.39) 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, the error value gets printed. Reported-by: kernel test robot Signed-off-by: Cai Huoqing --- v1->v2: Fix compile error-add ';' drivers/gpu/drm/tegra/sor.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 0ea320c1092b..d7964e498da9 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -2964,11 +2964,9 @@ static int tegra_sor_hdmi_probe(struct tegra_sor *sor) int err; sor->avdd_io_supply = devm_regulator_get(sor->dev, "avdd-io-hdmi-dp"); - if (IS_ERR(sor->avdd_io_supply)) { - dev_err(sor->dev, "cannot get AVDD I/O supply: %ld\n", - PTR_ERR(sor->avdd_io_supply)); - return PTR_ERR(sor->avdd_io_supply); - } + if (IS_ERR(sor->avdd_io_supply)) + return dev_err_probe(sor->dev, PTR_ERR(sor->avdd_io_supply), + "cannot get AVDD I/O supply\n"); err = tegra_sor_enable_regulator(sor, sor->avdd_io_supply); if (err < 0) { @@ -2978,11 +2976,9 @@ static int tegra_sor_hdmi_probe(struct tegra_sor *sor) } sor->vdd_pll_supply = devm_regulator_get(sor->dev, "vdd-hdmi-dp-pll"); - if (IS_ERR(sor->vdd_pll_supply)) { - dev_err(sor->dev, "cannot get VDD PLL supply: %ld\n", - PTR_ERR(sor->vdd_pll_supply)); - return PTR_ERR(sor->vdd_pll_supply); - } + if (IS_ERR(sor->vdd_pll_supply)) + return dev_err_probe(sor->dev, PTR_ERR(sor->vdd_pll_supply), + "cannot get VDD PLL supply\n"); err = tegra_sor_enable_regulator(sor, sor->vdd_pll_supply); if (err < 0) { @@ -2992,11 +2988,9 @@ static int tegra_sor_hdmi_probe(struct tegra_sor *sor) } sor->hdmi_supply = devm_regulator_get(sor->dev, "hdmi"); - if (IS_ERR(sor->hdmi_supply)) { - dev_err(sor->dev, "cannot get HDMI supply: %ld\n", - PTR_ERR(sor->hdmi_supply)); - return PTR_ERR(sor->hdmi_supply); - } + if (IS_ERR(sor->hdmi_supply)) + return dev_err_probe(sor->dev, PTR_ERR(sor->hdmi_supply), + "cannot get HDMI supply\n"); err = tegra_sor_enable_regulator(sor, sor->hdmi_supply); if (err < 0) { -- 2.25.1