From patchwork Sun Jun 29 16:21:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Heider X-Patchwork-Id: 4444721 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8AA109F32E for ; Sun, 29 Jun 2014 16:25:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BAC8A20328 for ; Sun, 29 Jun 2014 16:25:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E5384202F8 for ; Sun, 29 Jun 2014 16:25:11 +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 1X1HsQ-0003ZF-Q4; Sun, 29 Jun 2014 16:22:50 +0000 Received: from mail-we0-x22c.google.com ([2a00:1450:400c:c03::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X1Hrx-0003OH-5c for linux-arm-kernel@lists.infradead.org; Sun, 29 Jun 2014 16:22:21 +0000 Received: by mail-we0-f172.google.com with SMTP id u57so7166967wes.31 for ; Sun, 29 Jun 2014 09:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eXYN9bZ1F5rHm8Wt3PGabUAzi2UIkBbt322qYtQUVRQ=; b=YSDtNdc8rLUwJHRtkZwuVbBO20G/vo1mk0MxgSSKzb7mZ3sFk1e1xGZLJKbkoAPECe HnbLAUg9P05m1bHCewQdsoXpwPaxQyt9SG5U5OZmACl5dU5havQqxWh9NQsem/2E6RdN EsVYz80RNM8/MYti3LCHBlVTtKOw8kypuAGQN8sz2VwmKVw0kCRzxCI+5n8XuMjfz1wi qULKBUAoVWa65Z6THaQVpPYMLErrpuFrXtnxMu953Pct7BJYOfuozpW88PnXZBjToat3 gOfMViuCD9nH6wjbjz2PK5syi7XNzYn5rqjYCbfmTRVHm4fIT2vqxZJ+C/Hh3MNE7zTF 0FMw== X-Received: by 10.194.78.68 with SMTP id z4mr955190wjw.126.1404058919027; Sun, 29 Jun 2014 09:21:59 -0700 (PDT) Received: from mamamia.internal (a89-182-10-130.net-htp.de. [89.182.10.130]) by mx.google.com with ESMTPSA id gh16sm21137573wic.3.2014.06.29.09.21.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Jun 2014 09:21:58 -0700 (PDT) From: Andre Heider To: linux-omap@vger.kernel.org Subject: [PATCH 04/13] uio: uio_pruss: use dmam_alloc_coherent() Date: Sun, 29 Jun 2014 18:21:38 +0200 Message-Id: <1404058907-21112-5-git-send-email-a.heider@gmail.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1404058907-21112-1-git-send-email-a.heider@gmail.com> References: <1404058907-21112-1-git-send-email-a.heider@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140629_092221_398396_8C0BE9B5 X-CRM114-Status: GOOD ( 14.02 ) X-Spam-Score: -0.8 (/) Cc: devicetree@vger.kernel.org, Paul Walmsley , Tony Lindgren , Greg Kroah-Hartman , Matt Porter , "Hans J . Koch" , =?UTF-8?q?Beno=C3=AEt=20Cousson?= , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no 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 Replace dma_alloc_coherent() with dmam_alloc_coherent() and remove the dma_free_coherent() call. This shaves off 2 vars in the driver data struct. Signed-off-by: Andre Heider --- drivers/uio/uio_pruss.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c index 310598a..50ff206 100644 --- a/drivers/uio/uio_pruss.c +++ b/drivers/uio/uio_pruss.c @@ -63,10 +63,8 @@ struct uio_pruss_dev { struct uio_info *info; struct clk *pruss_clk; dma_addr_t sram_paddr; - dma_addr_t ddr_paddr; void __iomem *prussio_vaddr; unsigned long sram_vaddr; - void *ddr_vaddr; unsigned int hostirq_start; unsigned int pintc_base; struct gen_pool *sram_pool; @@ -100,10 +98,6 @@ static void pruss_cleanup(struct device *dev, struct uio_pruss_dev *gdev) uio_unregister_device(p); kfree(p->name); } - if (gdev->ddr_vaddr) { - dma_free_coherent(dev, extram_pool_sz, gdev->ddr_vaddr, - gdev->ddr_paddr); - } if (gdev->sram_vaddr) gen_pool_free(gdev->sram_pool, gdev->sram_vaddr, @@ -119,6 +113,7 @@ static int pruss_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; int ret = -ENODEV, cnt = 0; struct uio_pruss_pdata *pdata = dev_get_platdata(dev); + dma_addr_t ddr_paddr; gdev = devm_kzalloc(dev, sizeof(struct uio_pruss_dev), GFP_KERNEL); if (!gdev) @@ -155,9 +150,8 @@ static int pruss_probe(struct platform_device *pdev) } } - gdev->ddr_vaddr = dma_alloc_coherent(dev, extram_pool_sz, - &(gdev->ddr_paddr), GFP_KERNEL | GFP_DMA); - if (!gdev->ddr_vaddr) { + if (!dmam_alloc_coherent(dev, extram_pool_sz, &ddr_paddr, + GFP_KERNEL | GFP_DMA)) { dev_err(dev, "Could not allocate external memory\n"); goto out_free; } @@ -174,7 +168,7 @@ static int pruss_probe(struct platform_device *pdev) p->mem[1].size = sram_pool_sz; p->mem[1].memtype = UIO_MEM_PHYS; - p->mem[2].addr = gdev->ddr_paddr; + p->mem[2].addr = ddr_paddr; p->mem[2].size = extram_pool_sz; p->mem[2].memtype = UIO_MEM_PHYS;