From patchwork Sun Apr 26 02:05:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernard Zhao X-Patchwork-Id: 11510073 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 1B86F13B2 for ; Sun, 26 Apr 2020 02:05:54 +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 EDA4F2071E for ; Sun, 26 Apr 2020 02:05:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b78ztFT0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EDA4F2071E 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:MIME-Version:Message-Id:Date:Subject:To :From: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=jBgSNVC7KmnR3Cv9aT/8UdTY/AbIKcQXREgd2NojRBM=; b=b78ztFT08C7niw 6a8Ff8w4pKJoHYiNzEXbU+JpKGflG8w9uF/B6Xolcg32yD0WPg2nM1/qLpZ1zPDWmemx/+miyE1H8 mze6624H3zz4/drM0/PZCkGyxkOG5d1XKUVv6XLZ3+mUD8MMGtXP0Eb/LXJzLDalbsMRZdWkEsphN 0aShxBTgGu4snj0dNK4RKJ/jyXgKhDfLCw0gTnNs7i62UCAep/sV5gsrxsvqQMbEo/K/9woGOQ2qh Aq2ohuc2rc8XemUbWmgEuwzWcs7f+fBxhJEMUFjEWMw4oVoaSoheGZFS82AknJZm4e46bat6JUqeO P1peNFnzfDfASxNvMlyg==; 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 1jSWfz-00076h-I7; Sun, 26 Apr 2020 02:05:47 +0000 Received: from mail-m17613.qiye.163.com ([59.111.176.13]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSWfv-00074q-GI for linux-arm-kernel@lists.infradead.org; Sun, 26 Apr 2020 02:05:46 +0000 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 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 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZT1VPTkhCQkJCQk1KQ05IWVdZKFlBSE 83V1ktWUFJV1kJDhceCFlBWTU0KTY6NyQpLjc#WQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6PQg6Ijo4DDg*MEoIITceQjUB FUkKCTxVSlVKTkNMQ01NTEhPSUxMVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlKTkxV S1VISlVKSUlZV1kIAVlBSU5OTzcG X-HM-Tid: 0a71b43b8e7093bakuwsdb540482428 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200425_190543_703256_119129E4 X-CRM114-Status: GOOD ( 11.20 ) 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.13 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 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 --- 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);