aboutsummaryrefslogtreecommitdiffstats
path: root/lib/genalloc.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-03-06 04:44:28 -0500
committerMark Brown <broonie@linaro.org>2014-03-06 04:44:28 -0500
commitd083f580e5b940834a93ab741cdf064f0324dc0f (patch)
treed034075e47d68179d2f8bf7220d26bef0ba740d3 /lib/genalloc.c
parent931f27c6e892fdfe98896055e0df7962e21969d9 (diff)
parent13ff50c85846338bb9820abd3933227b678dc086 (diff)
Merge tag 'parse-val' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into asoc-core
regmap: Add parse_val() API This is useful for generic code built on top of regmap dealing with blocks of data.
Diffstat (limited to 'lib/genalloc.c')
-rw-r--r--lib/genalloc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/genalloc.c b/lib/genalloc.c
index dda31168844f..bdb9a456bcbb 100644
--- a/lib/genalloc.c
+++ b/lib/genalloc.c
@@ -316,7 +316,7 @@ EXPORT_SYMBOL(gen_pool_alloc);
316 * gen_pool_dma_alloc - allocate special memory from the pool for DMA usage 316 * gen_pool_dma_alloc - allocate special memory from the pool for DMA usage
317 * @pool: pool to allocate from 317 * @pool: pool to allocate from
318 * @size: number of bytes to allocate from the pool 318 * @size: number of bytes to allocate from the pool
319 * @dma: dma-view physical address 319 * @dma: dma-view physical address return value. Use NULL if unneeded.
320 * 320 *
321 * Allocate the requested number of bytes from the specified pool. 321 * Allocate the requested number of bytes from the specified pool.
322 * Uses the pool allocation function (with first-fit algorithm by default). 322 * Uses the pool allocation function (with first-fit algorithm by default).
@@ -334,7 +334,8 @@ void *gen_pool_dma_alloc(struct gen_pool *pool, size_t size, dma_addr_t *dma)
334 if (!vaddr) 334 if (!vaddr)
335 return NULL; 335 return NULL;
336 336
337 *dma = gen_pool_virt_to_phys(pool, vaddr); 337 if (dma)
338 *dma = gen_pool_virt_to_phys(pool, vaddr);
338 339
339 return (void *)vaddr; 340 return (void *)vaddr;
340} 341}