diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/mxc/output/mxc_vout.c | 10 | ||||
-rw-r--r-- | drivers/media/video/videobuf-dma-contig.c | 3 | ||||
-rw-r--r-- | drivers/mxc/vpu/mxc_vpu.c | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/drivers/media/video/mxc/output/mxc_vout.c b/drivers/media/video/mxc/output/mxc_vout.c index 4ea663005812..e0840bf7a1c2 100644 --- a/drivers/media/video/mxc/output/mxc_vout.c +++ b/drivers/media/video/mxc/output/mxc_vout.c @@ -2077,9 +2077,13 @@ static int mxc_vout_probe(struct platform_device *pdev) return -ENOMEM; dev->dev = &pdev->dev; - dev->dev->dma_mask = kmalloc(sizeof(*dev->dev->dma_mask), GFP_KERNEL); - *dev->dev->dma_mask = DMA_BIT_MASK(32); - dev->dev->coherent_dma_mask = DMA_BIT_MASK(32); + if (!dev->dev->dma_mask) { + dev->dev->dma_mask = kmalloc(sizeof(*dev->dev->dma_mask), + GFP_KERNEL); + if (dev->dev->dma_mask) + *dev->dev->dma_mask = DMA_BIT_MASK(32); + dev->dev->coherent_dma_mask = DMA_BIT_MASK(32); + } ret = v4l2_device_register(dev->dev, &dev->v4l2_dev); if (ret) { diff --git a/drivers/media/video/videobuf-dma-contig.c b/drivers/media/video/videobuf-dma-contig.c index af7ff78c9259..2a5623c5a213 100644 --- a/drivers/media/video/videobuf-dma-contig.c +++ b/drivers/media/video/videobuf-dma-contig.c @@ -284,7 +284,8 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q, mem->size = PAGE_ALIGN(buf->bsize); mem->vaddr = dma_alloc_coherent(q->dev, mem->size, - &mem->dma_handle, GFP_DMA); + &mem->dma_handle, + GFP_DMA | GFP_KERNEL | __GFP_NOFAIL); if (!mem->vaddr) { dev_err(q->dev, "dma_alloc_coherent size %ld failed\n", mem->size); diff --git a/drivers/mxc/vpu/mxc_vpu.c b/drivers/mxc/vpu/mxc_vpu.c index 708e8e97112a..07f6d9d1d6d8 100644 --- a/drivers/mxc/vpu/mxc_vpu.c +++ b/drivers/mxc/vpu/mxc_vpu.c @@ -126,7 +126,7 @@ static int vpu_alloc_dma_buffer(struct vpu_mem_desc *mem) mem->cpu_addr = (unsigned long) dma_alloc_coherent(NULL, PAGE_ALIGN(mem->size), (dma_addr_t *) (&mem->phy_addr), - GFP_DMA | GFP_KERNEL); + GFP_DMA | GFP_KERNEL | __GFP_NOFAIL); pr_debug("[ALLOC] mem alloc cpu_addr = 0x%x\n", mem->cpu_addr); if ((void *)(mem->cpu_addr) == NULL) { printk(KERN_ERR "Physical memory allocation error!\n"); |