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: 213383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A21EC28CBC for ; Wed, 6 May 2020 12:59:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC226206DB for ; Wed, 6 May 2020 12:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728272AbgEFM7U (ORCPT ); Wed, 6 May 2020 08:59:20 -0400 Received: from m176150.mail.qiye.163.com ([59.111.176.150]:28071 "EHLO m176150.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728081AbgEFM7U (ORCPT ); Wed, 6 May 2020 08:59:20 -0400 X-Greylist: delayed 583 seconds by postgrey-1.27 at vger.kernel.org; Wed, 06 May 2020 08:59:20 EDT 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 Cc: opensource.kernel@vivo.com, Bernard Zhao Subject: =?utf-8?q?=5BPATCH=5D_drm/exynos=3A_remove_no_need_devm=5Fkfree_?= =?utf-8?q?in_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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Remove no need devm_kfree in probe. The change is to make the code a bit more readable Signed-off-by: Bernard Zhao --- 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);