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: 1799481 Return-Path: X-Original-To: patchwork-linux-media@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 DFD343FC23 for ; Sun, 25 Nov 2012 14:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751589Ab2KYO5Q (ORCPT ); Sun, 25 Nov 2012 09:57:16 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:47517 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751514Ab2KYO5P (ORCPT ); Sun, 25 Nov 2012 09:57:15 -0500 Received: by mail-ee0-f46.google.com with SMTP id e53so4056493eek.19 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: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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); }