Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1157345pxb; Thu, 16 Sep 2021 00:38:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx3n9XGiB1etxLh7lRQ/Y9mf38AZ8o41wRyYuLaIBTac/3Zg5vddFuOzFs1YzmbSfFfgM4 X-Received: by 2002:a05:6e02:964:: with SMTP id q4mr3046917ilt.290.1631777921096; Thu, 16 Sep 2021 00:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631777921; cv=none; d=google.com; s=arc-20160816; b=ZUIWAAe0w5+lFl9t5Z17vHuEB/4MPD+EJ5+D8rXKTsanoLLlfEUU+jjb9U4GYSKZkU vnh87k2CiZ6xVzRZv9nd0/q9KS3clJQNadY315Z1oDw76KAJv0m1a0wbrU90+Kgyo2qb HLfpouejRIsI56yYZkSecfOighRp5YUm7wpqwWqX1XbgFqWs5HgJA4tTvuye5i8z2tGN Ur88W8We0/vTAVTGTUSBkhoBbcRUNQN0nfc8fjoON8q4LWBX4JiKsLl1dlZ+Mv/tuYYj 47BHJaOby8MbODq6zelER4UHJGnAp8YzvDKk6PGj/Y1rEvw2FzHimsZsK6JWiD4Xqy7J FPNA== 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=g6d1TubYwYyqhk7lHZTsmdarfpXW1oPHPqgJmq9NQy4=; b=1DuahzzbFilPDJB5oH4Tf2SETvGC+h0ZF0tWhQQdpZNHLAoz+iA230i+k0OaY7tWfi 81Yk/j+D+LsEotU6GkPfg9ozcf+KS2zhzEjmrDuutf8DrRmY3VREp1syCqxzH6JQcRl6 PjWk1YDC1U9kY3/JhyH05la8gZX9iMEFWX0rw5Y3OhNi0tFY7hPG1nddCvH2+S95H6ft PEwZLtniYb02nek1GrxF15zsAXyq1Nz4Hbel10jGn5zyi9GzX/V5J/dxYn12FW71xtfx G1N5Y7kOHvTj53FpiIOec93AprK9aeFKEwbyNYt2tpC8EDuPMqCnbs6pmOQ8ZBOUN/NJ RWTg== 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 u16si2225847ilb.175.2021.09.16.00.38.26; Thu, 16 Sep 2021 00:38:41 -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 S234887AbhIPHix (ORCPT + 99 others); Thu, 16 Sep 2021 03:38:53 -0400 Received: from mx22.baidu.com ([220.181.50.185]:43944 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234865AbhIPHiw (ORCPT ); Thu, 16 Sep 2021 03:38:52 -0400 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 Content-Type: text/plain 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-kernel@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; -- 2.25.1