From patchwork Thu Sep 16 07:37:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 1528663 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4H998b58f1z9sXS for ; Thu, 16 Sep 2021 18:23:43 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235077AbhIPIZC (ORCPT ); Thu, 16 Sep 2021 04:25:02 -0400 Received: from mx24.baidu.com ([111.206.215.185]:33586 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235069AbhIPIZB (ORCPT ); Thu, 16 Sep 2021 04:25:01 -0400 X-Greylist: delayed 1800 seconds by postgrey-1.27 at vger.kernel.org; Thu, 16 Sep 2021 04:25:01 EDT Received: from BC-Mail-EX08.internal.baidu.com (unknown [172.31.51.48]) by Forcepoint Email with ESMTPS id 31E261133E30DDCA424E; Thu, 16 Sep 2021 15:37:28 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-EX08.internal.baidu.com (172.31.51.48) 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 15:37:27 +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 15:37:26 +0800 From: Cai Huoqing To: CC: Thierry Reding , David Airlie , Daniel Vetter , Jonathan Hunter , , , Subject: [PATCH] drm/tegra: plane: Improve use of dev_err_probe() Date: Thu, 16 Sep 2021 15:37:21 +0800 Message-ID: <20210916073722.9110-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex09.internal.baidu.com (172.31.51.49) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Return dev_err_probe() directly, because the return value of dev_err_probe() is the appropriate error code, and it can reduce code size, simplify the code. Signed-off-by: Cai Huoqing --- drivers/gpu/drm/tegra/plane.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c index e00ec3f40ec8..e373411b1f0b 100644 --- a/drivers/gpu/drm/tegra/plane.c +++ b/drivers/gpu/drm/tegra/plane.c @@ -744,21 +744,17 @@ int tegra_plane_interconnect_init(struct tegra_plane *plane) plane->icc_mem = devm_of_icc_get(dev, icc_name); err = PTR_ERR_OR_ZERO(plane->icc_mem); - if (err) { - dev_err_probe(dev, err, "failed to get %s interconnect\n", - icc_name); - return err; - } + if (err) + return dev_err_probe(dev, err, "failed to get %s interconnect\n", + icc_name); /* plane B on T20/30 has a dedicated memory client for a 6-tap vertical filter */ if (plane->index == 1 && dc->soc->has_win_b_vfilter_mem_client) { plane->icc_mem_vfilter = devm_of_icc_get(dev, "winb-vfilter"); err = PTR_ERR_OR_ZERO(plane->icc_mem_vfilter); - if (err) { - dev_err_probe(dev, err, "failed to get %s interconnect\n", - "winb-vfilter"); - return err; - } + if (err) + return dev_err_probe(dev, err, "failed to get %s interconnect\n", + "winb-vfilter"); } return 0;