diff options
author | Nicolin Chen <b42378@freescale.com> | 2013-11-12 18:09:57 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:23 -0500 |
commit | 288342e9cc867421d20f940d0c06b7aa4bf39096 (patch) | |
tree | 06ef620bf8f84ed34d8496db84d97f17d1565bb0 /drivers/uio | |
parent | 43f950f454815cca2c39244c7441f9288d7389e0 (diff) |
drivers/uio/uio_pruss.c: use gen_pool_dma_alloc() to allocate sram memory
Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/uio')
-rw-r--r-- | drivers/uio/uio_pruss.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c index f519da9034b7..96c4a19b1918 100644 --- a/drivers/uio/uio_pruss.c +++ b/drivers/uio/uio_pruss.c | |||
@@ -158,14 +158,12 @@ static int pruss_probe(struct platform_device *dev) | |||
158 | if (pdata->sram_pool) { | 158 | if (pdata->sram_pool) { |
159 | gdev->sram_pool = pdata->sram_pool; | 159 | gdev->sram_pool = pdata->sram_pool; |
160 | gdev->sram_vaddr = | 160 | gdev->sram_vaddr = |
161 | gen_pool_alloc(gdev->sram_pool, sram_pool_sz); | 161 | (unsigned long)gen_pool_dma_alloc(gdev->sram_pool, |
162 | sram_pool_sz, &gdev->sram_paddr); | ||
162 | if (!gdev->sram_vaddr) { | 163 | if (!gdev->sram_vaddr) { |
163 | dev_err(&dev->dev, "Could not allocate SRAM pool\n"); | 164 | dev_err(&dev->dev, "Could not allocate SRAM pool\n"); |
164 | goto out_free; | 165 | goto out_free; |
165 | } | 166 | } |
166 | gdev->sram_paddr = | ||
167 | gen_pool_virt_to_phys(gdev->sram_pool, | ||
168 | gdev->sram_vaddr); | ||
169 | } | 167 | } |
170 | 168 | ||
171 | gdev->ddr_vaddr = dma_alloc_coherent(&dev->dev, extram_pool_sz, | 169 | gdev->ddr_vaddr = dma_alloc_coherent(&dev->dev, extram_pool_sz, |