From patchwork Tue Jan 29 07:36:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2059951 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A4CFA3FDD1 for ; Tue, 29 Jan 2013 07:36:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752717Ab3A2HgJ (ORCPT ); Tue, 29 Jan 2013 02:36:09 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:42964 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753143Ab3A2HgJ (ORCPT ); Tue, 29 Jan 2013 02:36:09 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHD00AGDMFIY2T0@mailout4.samsung.com> for linux-fbdev@vger.kernel.org; Tue, 29 Jan 2013 16:36:07 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.50]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 16.33.03880.7EB77015; Tue, 29 Jan 2013 16:36:07 +0900 (KST) X-AuditID: cbfee61b-b7fb06d000000f28-5e-51077be773e0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id D5.33.03880.7EB77015; Tue, 29 Jan 2013 16:36:07 +0900 (KST) Received: from DOJG1HAN02 ([12.23.120.99]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MHD00E02MG73I10@mmp1.samsung.com> for linux-fbdev@vger.kernel.org; Tue, 29 Jan 2013 16:36:07 +0900 (KST) From: Jingoo Han To: 'Florian Tobias Schandinat' Cc: linux-fbdev@vger.kernel.org, 'Jingoo Han' Subject: [PATCH 1/2] video: exynos_dp: add missing of_node_put() Date: Tue, 29 Jan 2013 16:36:07 +0900 Message-id: <00cb01cdfdf3$4ccdac00$e6690400$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac3980yxCRisXOzGT5GRKvJhwRF9kw== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRmVeSWpSXmKPExsVy+t8zI93n1eyBBrOeylqc6PvA6sDo8XmT XABjFJdNSmpOZllqkb5dAldG34r1rAVNAhXbzjayNTAu4O1i5OSQEDCR+DbhECuELSZx4d56 ti5GLg4hgWWMEm8fPGSGKfrxv40JIrGIUeLDlPWMEM4sJonNOzcyglSxCahJfPlymL2LkYND RMBKYtNWTZAws4CzxIQbJ9hAbGEBB4lvx3pYQEpYBFQlNt72AgnzCthK3OpczwJhC0r8mHyP BaJVS2L9zuNMELa8xOY1b5lBWiUE1CUe/dUFCYsI6Ek8PT6PHaJERGLfi3dgl0kIdLNLdPRu A7ufRUBA4tvkQywQvbISmw5AvSUpcXDFDZYJjGKzkGyehWTzLCSbZyFZsYCRZRWjaGpBckFx UnqukV5xYm5xaV66XnJ+7iZGSJxI72Bc1WBxiFGAg1GJh1djHlugEGtiWXFl7iFGCQ5mJRHe yBL2QCHelMTKqtSi/Pii0pzU4kOMyUDHTmSWEk3OB8ZwXkm8obGxiZmJqYm5pam5KWnCSuK8 jKeeBAgJpCeWpGanphakFsFsYeLglGpgzOyJ/nmH77Kv9o7smj3Niyq3nVOar1qw8WFoJn+b ndbGezwzA8SO3o/czW0o1XD8U/N0N4a9JrVLE0S5djcdrrWZZdq/lv3ghONTvA+ePt63oS8v ZE6LzQ7JPQxZ1U9/XF3mo79H6ya30bM1H7k3ntHvUlCK2JuTFS93c3dWWK3dr4W6UlwVSizF GYmGWsxFxYkAfV40U9cCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMIsWRmVeSWpSXmKPExsVy+t9jAd3n1eyBBvuuS1ic6PvA6sDo8XmT XABjVAOjTUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7Q VCWFssScUqBQQGJxsZK+HaYJoSFuuhYwjRG6viFBcD1GBmggYR1jRt+K9awFTQIV2842sjUw LuDtYuTkkBAwkfjxv40JwhaTuHBvPVsXIxeHkMAiRokPU9YzQjizmCQ279zICFLFJqAm8eXL YfYuRg4OEQEriU1bNUHCzALOEhNunGADsYUFHCS+HethASlhEVCV2HjbCyTMK2ArcatzPQuE LSjxY/I9FohWLYn1O48zQdjyEpvXvGUGaZUQUJd49FcXJCwioCfx9Pg8dogSEYl9L94xTmAU mIVk0iwkk2YhmTQLScsCRpZVjKKpBckFxUnpuUZ6xYm5xaV56XrJ+bmbGMFR+Ex6B+OqBotD jAIcjEo8vBrz2AKFWBPLiitzDzFKcDArifBGlrAHCvGmJFZWpRblxxeV5qQWH2JMBvpzIrOU aHI+MEHklcQbGpuYGVkamVkYmZibkyasJM7LeOpJgJBAemJJanZqakFqEcwWJg5OqQZGDZ1F 4bc2Ocx8Z8ss0PgjYivXvI+vXz76WW/ffEYmTVQnVn1T6AH+bQUeT12EQgoKZ+w29at2vR+y ZWFI8gr36kZpPfaw4ykH1C45Vcx7dc3l94sD+zr2Jt7Q1bAuCpq6vfr8szPfdi+49J2jeYGo 4Jn8qqty7nN/rjq+uSZ+hY7815dn+WVilFiKMxINtZiLihMBz5M5TAYDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org of_find_node_by_name() returns a node pointer with refcount incremented, use of_node_put() on it when done. of_find_node_by_name() will call of_node_put() against the node pass to from parameter, thus we also need to call of_node_get(from) before calling of_find_node_by_name(). Signed-off-by: Jingoo Han --- drivers/video/exynos/exynos_dp_core.c | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c index 2ed9776..c7374c0 100644 --- a/drivers/video/exynos/exynos_dp_core.c +++ b/drivers/video/exynos/exynos_dp_core.c @@ -965,10 +965,11 @@ static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev) static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp) { - struct device_node *dp_phy_node; + struct device_node *dp_phy_node = of_node_get(dp->dev->of_node); u32 phy_base; + int ret = 0; - dp_phy_node = of_find_node_by_name(dp->dev->of_node, "dptx-phy"); + dp_phy_node = of_find_node_by_name(dp_phy_node, "dptx-phy"); if (!dp_phy_node) { dev_err(dp->dev, "could not find dptx-phy node\n"); return -ENODEV; @@ -976,22 +977,28 @@ static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp) if (of_property_read_u32(dp_phy_node, "reg", &phy_base)) { dev_err(dp->dev, "faild to get reg for dptx-phy\n"); - return -EINVAL; + ret = -EINVAL; + goto err; } if (of_property_read_u32(dp_phy_node, "samsung,enable-mask", &dp->enable_mask)) { dev_err(dp->dev, "faild to get enable-mask for dptx-phy\n"); - return -EINVAL; + ret = -EINVAL; + goto err; } dp->phy_addr = ioremap(phy_base, SZ_4); if (!dp->phy_addr) { dev_err(dp->dev, "failed to ioremap dp-phy\n"); - return -ENOMEM; + ret = -ENOMEM; + goto err; } - return 0; +err: + of_node_put(dp_phy_node); + + return ret; } static void exynos_dp_phy_init(struct exynos_dp_device *dp)