aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-11-04 23:07:39 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 05:16:44 -0500
commit101b25b55ec48354bc40b9102b4f7922c9ad9eae (patch)
tree9a409a45c0c7ff943cccf02c9f494119c97e2153 /drivers
parent42e142f6b72493b5daec9950c4c83d20ccf56a0d (diff)
[media] drivers/media: Use vzalloc
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/ngene/ngene-core.c3
-rw-r--r--drivers/media/video/mx3_camera.c3
-rw-r--r--drivers/media/video/pwc/pwc-if.c3
-rw-r--r--drivers/media/video/videobuf-dma-sg.c3
4 files changed, 4 insertions, 8 deletions
diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c
index 3a7ef71087be..c7809f7da02e 100644
--- a/drivers/media/dvb/ngene/ngene-core.c
+++ b/drivers/media/dvb/ngene/ngene-core.c
@@ -1536,12 +1536,11 @@ int __devinit ngene_probe(struct pci_dev *pci_dev,
1536 if (pci_enable_device(pci_dev) < 0) 1536 if (pci_enable_device(pci_dev) < 0)
1537 return -ENODEV; 1537 return -ENODEV;
1538 1538
1539 dev = vmalloc(sizeof(struct ngene)); 1539 dev = vzalloc(sizeof(struct ngene));
1540 if (dev == NULL) { 1540 if (dev == NULL) {
1541 stat = -ENOMEM; 1541 stat = -ENOMEM;
1542 goto fail0; 1542 goto fail0;
1543 } 1543 }
1544 memset(dev, 0, sizeof(struct ngene));
1545 1544
1546 dev->pci_dev = pci_dev; 1545 dev->pci_dev = pci_dev;
1547 dev->card_info = (struct ngene_info *)id->driver_data; 1546 dev->card_info = (struct ngene_info *)id->driver_data;
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index aa871c2936b3..330d42e15498 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -1186,13 +1186,12 @@ static int __devinit mx3_camera_probe(struct platform_device *pdev)
1186 goto egetres; 1186 goto egetres;
1187 } 1187 }
1188 1188
1189 mx3_cam = vmalloc(sizeof(*mx3_cam)); 1189 mx3_cam = vzalloc(sizeof(*mx3_cam));
1190 if (!mx3_cam) { 1190 if (!mx3_cam) {
1191 dev_err(&pdev->dev, "Could not allocate mx3 camera object\n"); 1191 dev_err(&pdev->dev, "Could not allocate mx3 camera object\n");
1192 err = -ENOMEM; 1192 err = -ENOMEM;
1193 goto ealloc; 1193 goto ealloc;
1194 } 1194 }
1195 memset(mx3_cam, 0, sizeof(*mx3_cam));
1196 1195
1197 mx3_cam->clk = clk_get(&pdev->dev, NULL); 1196 mx3_cam->clk = clk_get(&pdev->dev, NULL);
1198 if (IS_ERR(mx3_cam->clk)) { 1197 if (IS_ERR(mx3_cam->clk)) {
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index f3dc89da4c4e..b821065e3870 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -287,14 +287,13 @@ static int pwc_allocate_buffers(struct pwc_device *pdev)
287 /* create frame buffers, and make circular ring */ 287 /* create frame buffers, and make circular ring */
288 for (i = 0; i < default_fbufs; i++) { 288 for (i = 0; i < default_fbufs; i++) {
289 if (pdev->fbuf[i].data == NULL) { 289 if (pdev->fbuf[i].data == NULL) {
290 kbuf = vmalloc(PWC_FRAME_SIZE); /* need vmalloc since frame buffer > 128K */ 290 kbuf = vzalloc(PWC_FRAME_SIZE); /* need vmalloc since frame buffer > 128K */
291 if (kbuf == NULL) { 291 if (kbuf == NULL) {
292 PWC_ERROR("Failed to allocate frame buffer %d.\n", i); 292 PWC_ERROR("Failed to allocate frame buffer %d.\n", i);
293 return -ENOMEM; 293 return -ENOMEM;
294 } 294 }
295 PWC_DEBUG_MEMORY("Allocated frame buffer %d at %p.\n", i, kbuf); 295 PWC_DEBUG_MEMORY("Allocated frame buffer %d at %p.\n", i, kbuf);
296 pdev->fbuf[i].data = kbuf; 296 pdev->fbuf[i].data = kbuf;
297 memset(kbuf, 0, PWC_FRAME_SIZE);
298 } 297 }
299 } 298 }
300 299
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c
index 20f227ee2b3e..ab684e807034 100644
--- a/drivers/media/video/videobuf-dma-sg.c
+++ b/drivers/media/video/videobuf-dma-sg.c
@@ -69,10 +69,9 @@ static struct scatterlist *videobuf_vmalloc_to_sg(unsigned char *virt,
69 struct page *pg; 69 struct page *pg;
70 int i; 70 int i;
71 71
72 sglist = vmalloc(nr_pages * sizeof(*sglist)); 72 sglist = vzalloc(nr_pages * sizeof(*sglist));
73 if (NULL == sglist) 73 if (NULL == sglist)
74 return NULL; 74 return NULL;
75 memset(sglist, 0, nr_pages * sizeof(*sglist));
76 sg_init_table(sglist, nr_pages); 75 sg_init_table(sglist, nr_pages);
77 for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) { 76 for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) {
78 pg = vmalloc_to_page(virt); 77 pg = vmalloc_to_page(virt);