From patchwork Wed May 6 12:49:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernard Zhao X-Patchwork-Id: 11531175 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4115D14C0 for ; Wed, 6 May 2020 12:49:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F42D20575 for ; Wed, 6 May 2020 12:49:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kRvCHuBa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F42D20575 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivo.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:From:MIME-Version:Subject:To: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=lKGkf5RAhTEu1Hto2rg+15N1+qHA9JWUqh5QXgzByLw=; b=kRvCHuBaztFanl MVWI4Uz6v960etbAUrQrSJEAidrGmDuLJe9YRPLSZUqz4xND7EK4IEptm2YwwR0yJhlxIAOh2lKma Yl7i2GhRx10+MonI6283X2zSZU/n/32RUymNuMhbWj+YjL3OfItMOt71RX+mtAFXYyLVe5OptC0fh zRDMxm7q+saMZG5/PTT/+J0IIVY8WM3ECJYgTzeVy7ppYCYFYKfAMVBltii13nQJFUVvjcfHLWmJo H8dt6fu6KNjRz1dS3ko9QGdRaE1Taye5qENSXRl/rMWGxgoA7hgt/WbE45gwNmcmq2P8tgmTCIQoH rEAZA2CEViv9Atw++PvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWJUc-0003jI-RB; Wed, 06 May 2020 12:49:42 +0000 Received: from m176150.mail.qiye.163.com ([59.111.176.150]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWJUZ-0003f4-Gj for linux-arm-kernel@lists.infradead.org; Wed, 06 May 2020 12:49:41 +0000 Received: from vivo.com (wm-10.qy.internal [127.0.0.1]) by m176150.mail.qiye.163.com (Hmail) with ESMTP id 6E7471A31C1; Wed, 6 May 2020 20:49:03 +0800 (CST) Message-ID: To: Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , David Airlie , Daniel Vetter , Kukjin Kim , Krzysztof Kozlowski , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: =?utf-8?q?=5BPATCH=5D_drm/exynos=3A_remove_no_need_devm=5Fkfree_in_?= =?utf-8?q?probe_=5Bre-send=2C_welcome_any_comments=5D?= X-Priority: 3 X-Mailer: HMail Webmail Server V2.0 Copyright (c) 2016-163.com X-Originating-IP: 157.0.31.122 MIME-Version: 1.0 Received: from bernard@vivo.com( [157.0.31.122) ] by ajax-webmail ( [127.0.0.1] ) ; Wed, 6 May 2020 20:49:03 +0800 (GMT+08:00) From: Bernard Date: Wed, 6 May 2020 20:49:03 +0800 (GMT+08:00) X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZT1VPQ0NCQkJDT0hOQkxPSllXWShZQU hPN1dZLVlBSVdZCQ4XHghZQVk1NCk2OjckKS43PlkG X-HM-Sender-Digest: e1kMHhlZQQ8JDh5XWRIfHhUPWUFZRzo2EDo4OjoyODg3OBgcGh4QCSIY AjAUOlVKVUpOQ0NMTUJIT0hOSkpVMxYaEhdVGR4JFRoJHzsNEg0UVRgUFkVZV1kSC1lBWUpOTFVL VUhKVUpJSVlXWQgBWUFITUlDNwY+ X-HM-Tid: 0a71ea0847e793b4kuws6e7471a31c1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_054939_716751_67F693F2 X-CRM114-Status: GOOD ( 10.05 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [59.111.176.150 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: opensource.kernel@vivo.com, Bernard Zhao Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Remove no need devm_kfree in probe. The change is to make the code a bit more readable Signed-off-by: Bernard Zhao Reviewed-by: Sam Ravnborg --- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c index 43fa0f26c052..e06f7d7a6695 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c @@ -181,10 +181,8 @@ static int exynos_dpi_parse_dt(struct exynos_dpi *ctx) return -ENOMEM; ret = of_get_videomode(dn, vm, 0); - if (ret < 0) { - devm_kfree(dev, vm); + if (ret < 0) return ret; - } ctx->vm = vm; @@ -233,10 +231,8 @@ struct drm_encoder *exynos_dpi_probe(struct device *dev) ctx->dev = dev; ret = exynos_dpi_parse_dt(ctx); - if (ret < 0) { - devm_kfree(dev, ctx); - return NULL; - } + if (ret < 0) + return ERR_PTR(ret); if (ctx->panel_node) { ctx->panel = of_drm_find_panel(ctx->panel_node);