From patchwork Fri Sep 7 06:44:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inderpal Singh X-Patchwork-Id: 11221 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 8378023F25 for ; Fri, 7 Sep 2012 06:44:59 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1A472A18D26 for ; Fri, 7 Sep 2012 06:44:58 +0000 (UTC) Received: by iafj25 with SMTP id j25so2689176iaf.11 for ; Thu, 06 Sep 2012 23:44:58 -0700 (PDT) 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:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=ODNB1ftueJez7zEGgKe3XIewfiDy71FlSoquV1lMTAE=; b=kHzao2pxPggv+7xTR6y7RQPS//75wYMEwUpCMXL2viKxovuUOT5kxDXNR6cySG4bD2 qpB3bpmdWqZWluTclTq7eLq0fzMu5LpLpwA9V+/sPTLaDVGsnqiKwcJTj88ApH5fQYQf v9wmBUNharjgN8JqezVizVRB/nUAY3mhMOU59PnVlt3HTYpcWtCURoNbmti4c3l9NciZ 3+DLTGbgnjyeQDVp+XEEIy6Rgx4gxISGYbEjGQo1EuARwcgAqwSyCOmEfI9Q8A9EfO89 vHMIwoQD3oOrPB+SzsIoaZqiVuhtODycuBK72dwCFE4CK4MQTqL7pp4/baArOl6zyTBb Oyog== Received: by 10.50.237.41 with SMTP id uz9mr6769350igc.43.1347000298496; Thu, 06 Sep 2012 23:44:58 -0700 (PDT) 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.184.232 with SMTP id ex8csp363079igc; Thu, 6 Sep 2012 23:44:57 -0700 (PDT) Received: by 10.68.237.3 with SMTP id uy3mr8889376pbc.30.1347000297249; Thu, 06 Sep 2012 23:44:57 -0700 (PDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id pv1si7389109pbb.359.2012.09.06.23.44.57 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 23:44:57 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of inderpal.singh@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of inderpal.singh@linaro.org) smtp.mail=inderpal.singh@linaro.org Received: by mail-pz0-f50.google.com with SMTP id e7so1792554dad.37 for ; Thu, 06 Sep 2012 23:44:57 -0700 (PDT) Received: by 10.66.73.133 with SMTP id l5mr7188903pav.74.1347000296959; Thu, 06 Sep 2012 23:44:56 -0700 (PDT) Received: from inder-ubuntu.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id vd4sm2624472pbc.41.2012.09.06.23.44.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 23:44:56 -0700 (PDT) From: Inderpal Singh To: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kgene.kim@samsung.com, vinod.koul@intel.com, patches@linaro.org, boojin.kim@samsung.com, jassisinghbrar@gmail.com, Inderpal Singh Subject: [PATCH 2/2] DMA: PL330: Remove redundant runtime_suspend/resume functions Date: Fri, 7 Sep 2012 12:14:48 +0530 Message-Id: <1347000288-20441-3-git-send-email-inderpal.singh@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1347000288-20441-1-git-send-email-inderpal.singh@linaro.org> References: <1347000288-20441-1-git-send-email-inderpal.singh@linaro.org> X-Gm-Message-State: ALoCoQlW28uRwJ4XxZ/A2HiFHGyNG/3RMBg0hqF0nfOMfcSOBSUpj0+NRhWrBu/I8Due/8ZA9w69 The driver's runtime_suspend/resume functions just disable/enable the clock which is already being managed at AMBA bus level runtime_suspend/resume functions. Hence, remove the driver's runtime_suspend/resume functions. Signed-off-by: Inderpal Singh --- drivers/dma/pl330.c | 61 +++++---------------------------------------------- 1 file changed, 5 insertions(+), 56 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index f70e783..d9e1433 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -586,8 +585,6 @@ struct dma_pl330_dmac { /* Peripheral channels connected to this DMAC */ struct dma_pl330_chan *peripherals; /* keep at end */ - - struct clk *clk; }; struct dma_pl330_desc { @@ -2887,24 +2884,17 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) goto probe_err1; } - pdmac->clk = clk_get(&adev->dev, "dma"); - if (IS_ERR(pdmac->clk)) { - dev_err(&adev->dev, "Cannot get operation clock.\n"); - ret = -EINVAL; - goto probe_err2; - } - amba_set_drvdata(adev, pdmac); irq = adev->irq[0]; ret = request_irq(irq, pl330_irq_handler, 0, dev_name(&adev->dev), pi); if (ret) - goto probe_err3; + goto probe_err2; ret = pl330_add(pi); if (ret) - goto probe_err4; + goto probe_err3; INIT_LIST_HEAD(&pdmac->desc_pool); spin_lock_init(&pdmac->pool_lock); @@ -2964,7 +2954,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) ret = dma_async_device_register(pd); if (ret) { dev_err(&adev->dev, "unable to register DMAC\n"); - goto probe_err5; + goto probe_err4; } dev_info(&adev->dev, @@ -2977,12 +2967,10 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) return 0; -probe_err5: - pl330_del(pi); probe_err4: - free_irq(irq, pi); + pl330_del(pi); probe_err3: - clk_put(pdmac->clk); + free_irq(irq, pi); probe_err2: iounmap(pi->base); probe_err1: @@ -3044,49 +3032,10 @@ static struct amba_id pl330_ids[] = { MODULE_DEVICE_TABLE(amba, pl330_ids); -#ifdef CONFIG_PM_RUNTIME -static int pl330_runtime_suspend(struct device *dev) -{ - struct dma_pl330_dmac *pdmac = dev_get_drvdata(dev); - - if (!pdmac) { - dev_err(dev, "failed to get dmac\n"); - return -ENODEV; - } - - clk_disable(pdmac->clk); - - return 0; -} - -static int pl330_runtime_resume(struct device *dev) -{ - struct dma_pl330_dmac *pdmac = dev_get_drvdata(dev); - - if (!pdmac) { - dev_err(dev, "failed to get dmac\n"); - return -ENODEV; - } - - clk_enable(pdmac->clk); - - return 0; -} -#else -#define pl330_runtime_suspend NULL -#define pl330_runtime_resume NULL -#endif /* CONFIG_PM_RUNTIME */ - -static const struct dev_pm_ops pl330_pm_ops = { - .runtime_suspend = pl330_runtime_suspend, - .runtime_resume = pl330_runtime_resume, -}; - static struct amba_driver pl330_driver = { .drv = { .owner = THIS_MODULE, .name = "dma-pl330", - .pm = &pl330_pm_ops, }, .id_table = pl330_ids, .probe = pl330_probe,