Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1270775pxb; Thu, 16 Sep 2021 03:57:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCTOhoV36SbVyB0xCaQIeDECZSFVBc3XSrqo27GV4PNN/20uqz77m5m/zVoUHDXkpDV+1I X-Received: by 2002:a02:2712:: with SMTP id g18mr3729500jaa.115.1631789850348; Thu, 16 Sep 2021 03:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631789850; cv=none; d=google.com; s=arc-20160816; b=Wanb3etuVlp3gG0esVjZn9wuFmL20JwWDSjf1BcCSjwEaVQ7QCWg7h9XqdLdd14D9y aYap8DL3BFpcf7pxtNsqHWlAmVu5/b27lpjN9kG5rEGbbETPq9HXlwHGxjJo8onVy/Tz y3LM/aswJdTm7yc17i/pvMXp65h+2qroFj7qkWmK89NdzosQvkqVfC8NGgwv25GbNLxd H5c2MwnIc7rv7Lq8/sXP8kyo1OYf3o+YzzoChQfZORlVqO16sRy4j7hnYSLEfD45GZCK 8+N2AuxQt/w6Vw2kUKZ+XyIKE+MAc751sQfRyUqS1dNC264b69X0VRsYgGSos1VJJ38W 8SUQ== 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=XPVYRt07umDq5pGC3lHRVSUrf/Z7Qo/rwCbnMXLAw9k=; b=yvhdK5jkRYgwhHPHBlHt7YbnmW+bBOx/Ph7EnHAoqptVGgbxUo8d9BCJ3knmbOGxvQ LUu4NMqu7raYff7IuQJqOZ9ESDcKGtsOmYvj0XkfXf0Cr2T/+nNZUn6daMK/gd5TlmUG dhcDoy9eeYSoHNF3e5oEyZ96jAyv6XxXOWrvHFwyN0rRAYc4+9hzqd9UPDoYB2b6QC6M DaEn+LO88raNcStnb9eT60qyP9Pw1ynL7kf/+DQJ63bDFYnY2eIdKudZJz2GOIWADa4R F491TEqtfw0wKgcOxDFQWXIOPuQrDHhUEbfsdIYwWjv8J3h5Opw9CLoM5nSZ1TLrKU1Z S8yQ== 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 n10si2316234iog.43.2021.09.16.03.57.17; Thu, 16 Sep 2021 03:57:30 -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 S237048AbhIPK5y (ORCPT + 99 others); Thu, 16 Sep 2021 06:57:54 -0400 Received: from mx24.baidu.com ([111.206.215.185]:35056 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235487AbhIPK5x (ORCPT ); Thu, 16 Sep 2021 06:57:53 -0400 Received: from BC-Mail-Ex11.internal.baidu.com (unknown [172.31.51.51]) by Forcepoint Email with ESMTPS id 6157DCA3F27F65723DA1; Thu, 16 Sep 2021 18:56:31 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex11.internal.baidu.com (172.31.51.51) 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:30 +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:30 +0800 From: Cai Huoqing To: CC: Maxime Ripard , Chen-Yu Tsai , "David Airlie" , Daniel Vetter , Jernej Skrabec , , , , Subject: [PATCH] drm/sun4i: dsi: Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 18:56:24 +0800 Message-ID: <20210916105625.12109-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/sun6i_mipi_dsi.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 4f5efcace68e..be60b16bcea9 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -1128,10 +1128,9 @@ static int sun6i_dsi_probe(struct platform_device *pdev) } dsi->regulator = devm_regulator_get(dev, "vcc-dsi"); - if (IS_ERR(dsi->regulator)) { - dev_err(dev, "Couldn't get VCC-DSI supply\n"); - return PTR_ERR(dsi->regulator); - } + if (IS_ERR(dsi->regulator)) + return dev_err_probe(dev, PTR_ERR(dsi->regulator), + "Couldn't get VCC-DSI supply\n"); dsi->reset = devm_reset_control_get_shared(dev, NULL); if (IS_ERR(dsi->reset)) { @@ -1146,10 +1145,9 @@ static int sun6i_dsi_probe(struct platform_device *pdev) } dsi->bus_clk = devm_clk_get(dev, bus_clk_name); - if (IS_ERR(dsi->bus_clk)) { - dev_err(dev, "Couldn't get the DSI bus clock\n"); - return PTR_ERR(dsi->bus_clk); - } + if (IS_ERR(dsi->bus_clk)) + return dev_err_probe(dev, PTR_ERR(dsi->bus_clk), + "Couldn't get the DSI bus clock\n"); ret = regmap_mmio_attach_clk(dsi->regs, dsi->bus_clk); if (ret) -- 2.25.1