From patchwork Wed Jul 8 12:59:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 6747071 Return-Path: X-Original-To: patchwork-linux-arm@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 352B69F38C for ; Wed, 8 Jul 2015 13:03:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CA26206B1 for ; Wed, 8 Jul 2015 13:03:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCE69205ED for ; Wed, 8 Jul 2015 13:03:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZCoyA-00034H-Qv; Wed, 08 Jul 2015 13:00:58 +0000 Received: from relay1.mentorg.com ([192.94.38.131]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZCoy1-0002xD-Ta for linux-arm-kernel@lists.infradead.org; Wed, 08 Jul 2015 13:00:50 +0000 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-UQ from Vladimir_Zapolskiy@mentor.com ; Wed, 08 Jul 2015 06:00:33 -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:52 +0100 From: Vladimir Zapolskiy To: David Airlie , Thierry Reding Subject: [PATCH 05/10] drm: panel-simple: use of_get_i2c_adapter_by_node interface Date: Wed, 8 Jul 2015 15:59:50 +0300 Message-ID: <1436360390-9373-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] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150708_060050_013963_A07048F8 X-CRM114-Status: UNSURE ( 8.96 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, dri-devel@lists.freedesktop.org, Wolfram Sang Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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(). Signed-off-by: Vladimir Zapolskiy --- drivers/gpu/drm/panel/panel-simple.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index f94201b..b8a8b23 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -313,7 +313,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0); if (ddc) { - panel->ddc = of_find_i2c_adapter_by_node(ddc); + panel->ddc = of_get_i2c_adapter_by_node(ddc); of_node_put(ddc); if (!panel->ddc) { @@ -335,8 +335,8 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) return 0; free_ddc: - if (panel->ddc) - put_device(&panel->ddc->dev); + i2c_put_adapter(panel->ddc); + free_backlight: if (panel->backlight) put_device(&panel->backlight->dev); @@ -353,8 +353,7 @@ static int panel_simple_remove(struct device *dev) panel_simple_disable(&panel->base); - if (panel->ddc) - put_device(&panel->ddc->dev); + i2c_put_adapter(panel->ddc); if (panel->backlight) put_device(&panel->backlight->dev);