aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/intel
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2018-08-18 11:16:54 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-31 09:24:33 -0400
commit1526dbeb54f202e9fa2de660fd18030ebaa99f49 (patch)
tree4f09f59cb344c3b58966221ea42a2625d9b4941d /drivers/media/pci/intel
parentmedia: i2c: Fix pm_runtime_get_if_in_use() usage in sensor drivers (diff)
downloadlinux-dev-1526dbeb54f202e9fa2de660fd18030ebaa99f49.tar.xz
linux-dev-1526dbeb54f202e9fa2de660fd18030ebaa99f49.zip
media: ipu3-cio2: Use dma_zalloc_coherent to replace dma_alloc_coherent + memset
dma_zalloc_coherent has implemented the dma_alloc_coherent() + memset(), We prefer to dma_zalloc_coherent instead of open-codeing. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/pci/intel')
-rw-r--r--drivers/media/pci/intel/ipu3/ipu3-cio2.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
index 29027159eced..f0c6374ee58e 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
@@ -218,13 +218,11 @@ static int cio2_fbpt_init(struct cio2_device *cio2, struct cio2_queue *q)
{
struct device *dev = &cio2->pci_dev->dev;
- q->fbpt = dma_alloc_coherent(dev, CIO2_FBPT_SIZE, &q->fbpt_bus_addr,
- GFP_KERNEL);
+ q->fbpt = dma_zalloc_coherent(dev, CIO2_FBPT_SIZE, &q->fbpt_bus_addr,
+ GFP_KERNEL);
if (!q->fbpt)
return -ENOMEM;
- memset(q->fbpt, 0, CIO2_FBPT_SIZE);
-
return 0;
}