]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/media/v4l2-core/videobuf2-dma-contig.c
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / drivers / media / v4l2-core / videobuf2-dma-contig.c
index 10beaee7f0ae592ae88803d7720d298a20beac0d..fd56f25632018fde92f1acefc4d284e6a47d6dba 100644 (file)
@@ -152,7 +152,7 @@ static void vb2_dc_put(void *buf_priv)
        kfree(buf);
 }
 
-static void *vb2_dc_alloc(void *alloc_ctx, unsigned long size)
+static void *vb2_dc_alloc(void *alloc_ctx, unsigned long size, gfp_t gfp_flags)
 {
        struct vb2_dc_conf *conf = alloc_ctx;
        struct device *dev = conf->dev;
@@ -162,10 +162,8 @@ static void *vb2_dc_alloc(void *alloc_ctx, unsigned long size)
        if (!buf)
                return ERR_PTR(-ENOMEM);
 
-       /* align image size to PAGE_SIZE */
-       size = PAGE_ALIGN(size);
-
-       buf->vaddr = dma_alloc_coherent(dev, size, &buf->dma_addr, GFP_KERNEL);
+       buf->vaddr = dma_alloc_coherent(dev, size, &buf->dma_addr,
+                                               GFP_KERNEL | gfp_flags);
        if (!buf->vaddr) {
                dev_err(dev, "dma_alloc_coherent of size %ld failed\n", size);
                kfree(buf);