Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1429524ybz; Sat, 25 Apr 2020 19:11:49 -0700 (PDT) X-Google-Smtp-Source: APiQypICvQHGDBndBlsa0XRsaawUkKraZng+jujYTA58GOilBqd0ltjUucjbeVJfsj/CVZAx0yxd X-Received: by 2002:a17:906:7f13:: with SMTP id d19mr13872612ejr.57.1587867109084; Sat, 25 Apr 2020 19:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587867109; cv=none; d=google.com; s=arc-20160816; b=Y8yXKDp3LBD/vAoRSzBnOji34A20QeaouB+mMb7A/QiSqbE3ELxdVY2wqlXolnozA9 Jvg38cWRA6oTmAbj+Jn8N9b49dQOs1+i8b7vpiFXUuh3pRVK/ixu2AdHi3VSJ3S1kSzO VlCeUMFLjJuPSkG9X/4BMeGeH+rhx6OxM2aJ9RwjV5cZJj2VVjHclIeuSR/Plp4lUfAA kY0gc7AkRB/+BvGSve+c4mjYqlz+RUIKA9hXTR2mexXXrienXIO5Ik5fPLZIFIEWvHfk +Z6vueTUVNzQhjAnEmOFSwdzgrx3pJjyyC0XsZL3xbDOARgl+gzSl8ysNEa3OqTrHwY8 2L8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Arvn7M316crcX82/LD3Py7ZNkU5V7BO9Rd3Y7Hlb92Q=; b=v+RbMlr1jfCi4rtX2z2/9Rl9rgb+6Zs/RSEq13eSbEajRAwbbhU+JmKefmCEf39Jbr 9/317A5A10QwqmqikY7ozAVLKKZAFFronNFDHMuAbeMaCKaDgFLIMlJhyq92L4irvhXD EZ5YI6f1smUSfg3pENni5PD3snhYJ3FEXqhZQaBpWxUbxRndrymeR/eE/fTSwOP7f2Yh 02cDF//xl4YdLB8bP3vMMOURfL1v1QWvLDnsKQGUEybtwRTMcECv4fw0nLHlUeusDPNN UYM4X3v4BjDw/0wOCyvZGYnCxQIomXYv8JplW83srwCrLmx+I63NV30o82QhBpjjPRm4 x2EQ== 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 b4si2267451ejj.10.2020.04.25.19.11.23; Sat, 25 Apr 2020 19:11:49 -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 S1726131AbgDZCFh (ORCPT + 99 others); Sat, 25 Apr 2020 22:05:37 -0400 Received: from mail-m17613.qiye.163.com ([59.111.176.13]:28010 "EHLO mail-m17613.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbgDZCFh (ORCPT ); Sat, 25 Apr 2020 22:05:37 -0400 Received: from ubuntu.localdomain (unknown [157.0.31.122]) by mail-m17613.qiye.163.com (Hmail) with ESMTPA id DB540482428; Sun, 26 Apr 2020 10:05:33 +0800 (CST) From: Bernard Zhao 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: [PATCH] drm/exynos: remove no need devm_kfree in probe Date: Sat, 25 Apr 2020 19:05:26 -0700 Message-Id: <20200426020526.18462-1-bernard@vivo.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZT1VPTkhCQkJCQk1KQ05IWVdZKFlBSE 83V1ktWUFJV1kJDhceCFlBWTU0KTY6NyQpLjc#WQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6PQg6Ijo4DDg*MEoIITceQjUB FUkKCTxVSlVKTkNMQ01NTEhPSUxMVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlKTkxV S1VISlVKSUlZV1kIAVlBSU5OTzcG X-HM-Tid: 0a71b43b8e7093bakuwsdb540482428 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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); -- 2.26.2