Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1271599pxb; Thu, 16 Sep 2021 03:59:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8501uUEW/+ItGXlTRmopJgwk86y57cXztJ1ovJOKlDpkIImxwRWDaSsJkXLi5DXEqpoof X-Received: by 2002:a6b:cd01:: with SMTP id d1mr470525iog.88.1631789947279; Thu, 16 Sep 2021 03:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631789947; cv=none; d=google.com; s=arc-20160816; b=LaIze8QpolRh9OZ6AOWerLCeTrMpbDPIdP1aSwbLokywme2i3qS3ASN/jSPgSu6/ua LW69eQ0oyA9xN+iU7fuNY5Q5Rj8uapoIDB1fe1lH11/si9orJp4fIr0Pus0vdd8ZXQCr 2rFqbz8W/9wEmLhjukhzeRW7SDP8xc2svJykQkLdWwkqCfF9FpWXL0qzipZZx8ZOrzdQ KrP1/6uJFgcIfX6r0O2XxuCU+jCAr8Pso0HCuxnGmTzMD01/LIEv0fxCjehoVCmT/lWv VySw6FAEkRrNL5rTlOdIQXSUSsyQ+nz29Ue1aoAmFmd575RKD2jtp+NR1LQWIvXeohHI ao3A== 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=w9VjXbmwjzBUUdheGvGVE2OxqUKgx7lZvdhbmJ5ssjM=; b=0mXvqceOeC6cQdsCNeE+xx1h0D9ioOzXH4MrlL5Txo2pi07HG1yZ4OKknuE8T+TAKY pt0/CNJ7mz04Xkvb0G0Je6SqzQ4LQ1aO/WIiLhOqX02EKGNCCBfr/ckWF7xpmDceAb03 Ar3du6L/LsmU4GZPi6jvTVeB7O2ZAcfXnpQo3jbttHkgq+9yqy8Iu+NXdm/6pCR1gx1H 71F66UrLEomPFqy4GxSu/AQsA50N3VWGFuuJHayU9tQSVR0Pb1698PuljBalXjPzhtHE c6AQObh9cJCmkZl7U6OTX5bncf55rODEH2QfrGk6so2ZYMJ+bS3d8M5PmOcKV3NmaWJ6 5QcQ== 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 m10si3009257ilu.53.2021.09.16.03.58.55; Thu, 16 Sep 2021 03:59:07 -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 S237262AbhIPK6B (ORCPT + 99 others); Thu, 16 Sep 2021 06:58:01 -0400 Received: from mx24.baidu.com ([111.206.215.185]:35222 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237193AbhIPK6B (ORCPT ); Thu, 16 Sep 2021 06:58:01 -0400 Received: from BC-Mail-Ex09.internal.baidu.com (unknown [172.31.51.49]) by Forcepoint Email with ESMTPS id 35A309D0935FBB00736D; Thu, 16 Sep 2021 18:56:39 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex09.internal.baidu.com (172.31.51.49) 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:56:39 +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:56:38 +0800 From: Cai Huoqing To: CC: Maxime Ripard , Chen-Yu Tsai , "Jernej Skrabec" , David Airlie , "Daniel Vetter" , , , , Subject: [PATCH] drm/sun4i: dw-hdmi: Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 18:56:32 +0800 Message-ID: <20210916105633.12162-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, the error value gets printed. Signed-off-by: Cai Huoqing --- drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c index f75fb157f2ff..21d473deb757 100644 --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c @@ -153,22 +153,19 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master, return -EPROBE_DEFER; hdmi->rst_ctrl = devm_reset_control_get(dev, "ctrl"); - if (IS_ERR(hdmi->rst_ctrl)) { - dev_err(dev, "Could not get ctrl reset control\n"); - return PTR_ERR(hdmi->rst_ctrl); - } + if (IS_ERR(hdmi->rst_ctrl)) + return dev_err_probe(dev, PTR_ERR(hdmi->rst_ctrl), + "Could not get ctrl reset control\n"); hdmi->clk_tmds = devm_clk_get(dev, "tmds"); - if (IS_ERR(hdmi->clk_tmds)) { - dev_err(dev, "Couldn't get the tmds clock\n"); - return PTR_ERR(hdmi->clk_tmds); - } + if (IS_ERR(hdmi->clk_tmds)) + return dev_err_probe(dev, PTR_ERR(hdmi->clk_tmds), + "Couldn't get the tmds clock\n"); hdmi->regulator = devm_regulator_get(dev, "hvcc"); - if (IS_ERR(hdmi->regulator)) { - dev_err(dev, "Couldn't get regulator\n"); - return PTR_ERR(hdmi->regulator); - } + if (IS_ERR(hdmi->regulator)) + return dev_err_probe(dev, PTR_ERR(hdmi->regulator), + "Couldn't get regulator\n"); ret = sun8i_dw_hdmi_find_connector_pdev(dev, &connector_pdev); if (!ret) { -- 2.25.1