From patchwork Tue Dec 6 10:45:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 5512 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 2288123E18 for ; Tue, 6 Dec 2011 10:49:27 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 193B7A18948 for ; Tue, 6 Dec 2011 10:49:27 +0000 (UTC) Received: by mail-ey0-f180.google.com with SMTP id c11so6379898eaa.11 for ; Tue, 06 Dec 2011 02:49:27 -0800 (PST) Received: by 10.213.33.203 with SMTP id i11mr2214623ebd.32.1323168566839; Tue, 06 Dec 2011 02:49:26 -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.205.129.2 with SMTP id hg2cs41440bkc; Tue, 6 Dec 2011 02:49:26 -0800 (PST) Received: by 10.50.169.99 with SMTP id ad3mr14520753igc.6.1323168564863; Tue, 06 Dec 2011 02:49:24 -0800 (PST) Received: from mail-iy0-f178.google.com (mail-iy0-f178.google.com [209.85.210.178]) by mx.google.com with ESMTPS id lw3si11280383icb.126.2011.12.06.02.49.24 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Dec 2011 02:49:24 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.210.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by mail-iy0-f178.google.com with SMTP id h11so498013iae.37 for ; Tue, 06 Dec 2011 02:49:24 -0800 (PST) Received: by 10.50.196.137 with SMTP id im9mr14635805igc.32.1323168564327; Tue, 06 Dec 2011 02:49:24 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ds5sm22761051ibb.5.2011.12.06.02.49.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Dec 2011 02:49:23 -0800 (PST) From: Tushar Behera To: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kgene.kim@samsung.com, vinod.koul@intel.com, linaro-dev@lists.linaro.org, patches@linaro.org Subject: [PATCH 1/2] DMA: PL330: Remove pm_runtime_xxx calls from pl330 probe/remove Date: Tue, 6 Dec 2011 16:15:54 +0530 Message-Id: <1323168355-2764-2-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1323168355-2764-1-git-send-email-tushar.behera@linaro.org> References: <1323168355-2764-1-git-send-email-tushar.behera@linaro.org> amba_probe() now calls pm_runtime_get_noresume() and pm_runtime_enable() for the devices before the device probe is called. Hence we don't need to call pm_runtime_get_xxx and pm_runtime_enable() in device probe again. In the same way, since amba_remove() calls the respective pm_runtime functions, those functions need not be called from device remove. This patch fixes following run time error with pl330 driver. dma-pl330 dma-pl330.0: Unbalanced pm_runtime_enable! dma-pl330 dma-pl330.0: failed to get runtime pm Signed-off-by: Giridhar Maruthy Signed-off-by: Tushar Behera Acked-by: Vinod Koul --- drivers/dma/pl330.c | 17 ++--------------- 1 files changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index a626e15..cd07121 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -834,17 +834,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) amba_set_drvdata(adev, pdmac); -#ifdef CONFIG_PM_RUNTIME - /* to use the runtime PM helper functions */ - pm_runtime_enable(&adev->dev); - - /* enable the power domain */ - if (pm_runtime_get_sync(&adev->dev)) { - dev_err(&adev->dev, "failed to get runtime pm\n"); - ret = -ENODEV; - goto probe_err1; - } -#else +#ifndef CONFIG_PM_RUNTIME /* enable dma clk */ clk_enable(pdmac->clk); #endif @@ -977,10 +967,7 @@ static int __devexit pl330_remove(struct amba_device *adev) res = &adev->res; release_mem_region(res->start, resource_size(res)); -#ifdef CONFIG_PM_RUNTIME - pm_runtime_put(&adev->dev); - pm_runtime_disable(&adev->dev); -#else +#ifndef CONFIG_PM_RUNTIME clk_disable(pdmac->clk); #endif