From: Andre Heider <a.heider@gmail.com>
To: linux-omap@vger.kernel.org
Cc: "Matt Porter" <mporter@linaro.org>,
"Hans J . Koch" <hjk@hansjkoch.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Benoît Cousson" <bcousson@baylibre.com>,
"Paul Walmsley" <paul@pwsan.com>,
"Tony Lindgren" <tony@atomide.com>,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Subject: [PATCH 04/13] uio: uio_pruss: use dmam_alloc_coherent()
Date: Sun, 29 Jun 2014 18:21:38 +0200 [thread overview]
Message-ID: <1404058907-21112-5-git-send-email-a.heider@gmail.com> (raw)
In-Reply-To: <1404058907-21112-1-git-send-email-a.heider@gmail.com>
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 <a.heider@gmail.com>
---
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;
--
2.0.0
next prev parent reply other threads:[~2014-06-29 16:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-29 16:21 [PATCH 00/13] uio_pruss: add support for devicetree and am33xx Andre Heider
2014-06-29 16:21 ` [PATCH 02/13] uio: uio_pruss: use devm_kzalloc() Andre Heider
2014-06-30 9:38 ` Mark Rutland
2014-06-30 19:42 ` Andre Heider
2014-06-29 16:21 ` [PATCH 03/13] uio: uio_pruss: use devm_ioremap_resource() Andre Heider
2014-06-29 16:21 ` Andre Heider [this message]
[not found] ` <1404058907-21112-1-git-send-email-a.heider-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-06-29 16:21 ` [PATCH 01/13] uio: uio_pruss: use struct device Andre Heider
2014-06-29 16:21 ` [PATCH 05/13] ARM: OMAP2+: hwmod: Introduce a flag to deassert the HW reset line Andre Heider
2014-06-29 16:21 ` [PATCH 06/13] ARM: AM33XX: hwmod: deassert PRUSS' hardreset lines Andre Heider
2014-06-29 16:21 ` [PATCH 07/13] Documentation: devicetree: add bindings for TI PRUSS Andre Heider
2014-06-30 9:33 ` Mark Rutland
2014-06-30 19:36 ` Andre Heider
2014-06-29 16:21 ` [PATCH 08/13] uio: uio_pruss: make the UIO SRAM memory region optional Andre Heider
2014-06-29 16:21 ` [PATCH 09/13] uio: uio_pruss: add devicetree support Andre Heider
2014-06-30 9:36 ` Mark Rutland
2014-06-30 19:39 ` Andre Heider
2014-06-29 16:21 ` [PATCH 10/13] uio: uio_pruss: add runtime pm support Andre Heider
2014-06-29 16:21 ` [PATCH 11/13] uio: uio_pruss: enable the driver for am33xx SoCs Andre Heider
2014-06-29 16:21 ` [PATCH 12/13] ARM: dts: am33xx: add the PRUSSv2 device Andre Heider
2014-06-30 9:36 ` Mark Rutland
2014-06-30 19:40 ` Andre Heider
2014-06-29 16:21 ` [PATCH 13/13] ARM: dts: am335x-boneblack: enable " Andre Heider
2014-07-07 8:48 ` [PATCH 00/13] uio_pruss: add support for devicetree and am33xx Andre Heider
2014-07-07 17:50 ` Paul Walmsley
2014-07-09 10:16 ` Hans J. Koch
2014-07-09 13:19 ` Andre Heider
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1404058907-21112-5-git-send-email-a.heider@gmail.com \
--to=a.heider@gmail.com \
--cc=bcousson@baylibre.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hjk@hansjkoch.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=mporter@linaro.org \
--cc=paul@pwsan.com \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).