From patchwork Sun Nov 25 14:57:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 13168 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 72C9723FC1 for ; Sun, 25 Nov 2012 14:57:18 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id E20DCA18320 for ; Sun, 25 Nov 2012 14:57:17 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so4656897iag.11 for ; Sun, 25 Nov 2012 06:57:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding:x-gm-message-state; bh=Zyy3NAACNsKmGdl4B28CSP7EYbjH+YU2v4OHxsftM04=; b=iJcMlHEJrYZD0Ig+6DBP+dA++5fa5hx6J37OHtelyyZf1KPgU2+OZm0XwaVVbKB0a8 nsX784CjyXeGmHK/BshSXz6ad4A9qzcFI9yAiydLUa1NzwhLIn+XMUYcPDJt9HupHDbv FVycMUwxkoEZY/vZ6H0Fr1jd0xO0f5M5P62ds95cYS9/BuXxuH6rjZfVWvsVOwbw085T SOznNrtpSdCVhkmByNDlbBE40Fi2DndCQiIUUJ8lkqbI+SWed/4cyq1d8EKPQ+L2WCvR q1KFEX8vpndvp53ehLIAcjJC558d0yWyx3BjJvd9xzrng2TBpn7JG3iIbURo1tJHCpDw yl2A== Received: by 10.50.213.69 with SMTP id nq5mr11038418igc.70.1353855437280; Sun, 25 Nov 2012 06:57:17 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp135710igt; Sun, 25 Nov 2012 06:57:16 -0800 (PST) Received: by 10.14.218.69 with SMTP id j45mr34335623eep.35.1353855435875; Sun, 25 Nov 2012 06:57:15 -0800 (PST) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx.google.com with ESMTPS id i42si23228949eem.112.2012.11.25.06.57.14 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 25 Nov 2012 06:57:15 -0800 (PST) Received-SPF: pass (google.com: domain of sylvester.nawrocki@gmail.com designates 74.125.83.54 as permitted sender) client-ip=74.125.83.54; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sylvester.nawrocki@gmail.com designates 74.125.83.54 as permitted sender) smtp.mail=sylvester.nawrocki@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-ee0-f54.google.com with SMTP id c13so5956305eek.41 for ; Sun, 25 Nov 2012 06:57:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Zyy3NAACNsKmGdl4B28CSP7EYbjH+YU2v4OHxsftM04=; b=IKtWI+MigzO5S/cB5AkKmN6W9qpDe9SGiON3/LffiKHha5NSQnbPfnHTH+cCje6A/u +vkVeDhdADauy4uNyCDUthPV7sqvtpKzhOrZ4Z6q78YzhaIvRvYZfkZYSYd0WJwSfrCc 1aj4mAlGpAGEX0vKlpB95xWjP0ByENh9sLu92FOiIsC/QMdfBTF8ZFSUOMaTuqiPVMVm Aq8yrjMsR7kFSKelCciLOvjMFUguULzRYNIYOddmymx7aw10e8bk2yyvSEBECJjtkaln MZ0HAepD1wVqawKVTB8woo1/sE67C1KPA3Fl3VsR49LoN9fR1uZJVmedqY63j0RlvnPL S0ww== Received: by 10.14.221.9 with SMTP id q9mr35092966eep.3.1353855434401; Sun, 25 Nov 2012 06:57:14 -0800 (PST) Received: from [192.168.1.110] (178235118103.warszawa.vectranet.pl. [178.235.118.103]) by mx.google.com with ESMTPS id g47sm27821491eeo.6.2012.11.25.06.57.12 (version=SSLv3 cipher=OTHER); Sun, 25 Nov 2012 06:57:13 -0800 (PST) Message-ID: <50B231C8.9040807@gmail.com> Date: Sun, 25 Nov 2012 15:57:12 +0100 From: Sylwester Nawrocki User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120412 Thunderbird/11.0.1 MIME-Version: 1.0 To: Shaik Ameer Basha , Sachin Kamat CC: Sylwester Nawrocki , linux-media@vger.kernel.org, patches@linaro.org Subject: Re: [PATCH v2 0/4] [media] exynos-gsc: Some fixes References: <1353668682-13366-1-git-send-email-sachin.kamat@linaro.org> In-Reply-To: X-Gm-Message-State: ALoCoQnyQ7MVxrW8DL9c31kUFh5XjdhwusD0Cr2k+kHejUxzeDOs4LD79THRy/lWOsakSC8RtksG Thanks Shaik, Sachin, I've applied the last patch fixing the checkpatch.pl warning. As for the remaining three, can you please squash them, together with following patch From cb7b42d2089206c8134fa195c0d1f4145fcb4f72 Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Sun, 25 Nov 2012 14:16:02 +0100 Subject: [PATCH] exynos-gsc: Correct clock handling Make sure there is no unbalanced clk_unprepare call and add missing clock release in the driver's remove() callback. Signed-off-by: Sylwester Nawrocki --- drivers/media/platform/exynos-gsc/gsc-core.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) static int gsc_clk_get(struct gsc_dev *gsc) @@ -1025,6 +1023,7 @@ static int gsc_clk_get(struct gsc_dev *gsc) if (ret < 0) { dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n", GSC_CLOCK_GATE_NAME); + gsc->clock = ERR_PTR(-EINVAL); return ret; } @@ -1097,6 +1096,7 @@ static int gsc_probe(struct platform_device *pdev) init_waitqueue_head(&gsc->irq_queue); spin_lock_init(&gsc->slock); mutex_init(&gsc->lock); + gsc->clock = ERR_PTR(-EINVAL); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); gsc->regs = devm_request_and_ioremap(dev, res); @@ -1160,6 +1160,7 @@ static int __devexit gsc_remove(struct platform_device *pdev) vb2_dma_contig_cleanup_ctx(gsc->alloc_ctx); pm_runtime_disable(&pdev->dev); + gsc_clk_put(gsc); dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name); return 0; diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 5a285b2..0c22ad5 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1002,10 +1002,8 @@ static void *gsc_get_drv_data(struct platform_device *pdev) static void gsc_clk_put(struct gsc_dev *gsc) { - if (IS_ERR_OR_NULL(gsc->clock)) - return; - - clk_unprepare(gsc->clock); + if (!IS_ERR(gsc->clock)) + clk_unprepare(gsc->clock); }