From patchwork Wed Jul 8 12:59:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 6746951 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 08F979F38C for ; Wed, 8 Jul 2015 13:00:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 33C70206B1 for ; Wed, 8 Jul 2015 13:00:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E7243206BA for ; Wed, 8 Jul 2015 13:00:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758757AbbGHNAe (ORCPT ); Wed, 8 Jul 2015 09:00:34 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:47696 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932306AbbGHNAd (ORCPT ); Wed, 8 Jul 2015 09:00:33 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ZCoxk-0004Ak-Ad from Vladimir_Zapolskiy@mentor.com ; Wed, 08 Jul 2015 06:00:32 -0700 Received: from eyas.fin.mentorg.com (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 8 Jul 2015 13:59:39 +0100 From: Vladimir Zapolskiy To: David Airlie , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park CC: Kukjin Kim , Krzysztof Kozlowski , Wolfram Sang , , , , Subject: [PATCH 03/10] drm: exynos_hdmi: use of_get_i2c_adapter_by_node interface Date: Wed, 8 Jul 2015 15:59:34 +0300 Message-ID: <1436360374-9275-1-git-send-email-vladimir_zapolskiy@mentor.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436360095-9065-1-git-send-email-vladimir_zapolskiy@mentor.com> References: <1436360095-9065-1-git-send-email-vladimir_zapolskiy@mentor.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.76] Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This change is needed to properly lock I2C bus driver, which serves DDC. On release of_get_i2c_adapter_by_node() requires i2c_put_adapter() call, which replaces put_device(). By the way added of_node_put(ddc_node) to eliminate memory leak, if OF_DYNAMIC is enabled. Signed-off-by: Vladimir Zapolskiy --- drivers/gpu/drm/exynos/exynos_hdmi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 99e2864..399eff9 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -2407,7 +2407,8 @@ static int hdmi_probe(struct platform_device *pdev) } out_get_ddc_adpt: - hdata->ddc_adpt = of_find_i2c_adapter_by_node(ddc_node); + hdata->ddc_adpt = of_get_i2c_adapter_by_node(ddc_node); + of_node_put(ddc_node); if (!hdata->ddc_adpt) { DRM_ERROR("Failed to get ddc i2c adapter by node\n"); return -EPROBE_DEFER; @@ -2485,7 +2486,7 @@ err_hdmiphy: if (hdata->hdmiphy_port) put_device(&hdata->hdmiphy_port->dev); err_ddc: - put_device(&hdata->ddc_adpt->dev); + i2c_put_adapter(hdata->ddc_adpt); return ret; } @@ -2501,7 +2502,7 @@ static int hdmi_remove(struct platform_device *pdev) if (hdata->hdmiphy_port) put_device(&hdata->hdmiphy_port->dev); - put_device(&hdata->ddc_adpt->dev); + i2c_put_adapter(hdata->ddc_adpt); pm_runtime_disable(&pdev->dev); component_del(&pdev->dev, &hdmi_component_ops);