fbdev: da8xx-fb: Use dma_zalloc_coherent
authorJoe Perches <joe@perches.com>
Sun, 15 Jun 2014 20:37:54 +0000 (13:37 -0700)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 1 Jul 2014 10:32:31 +0000 (13:32 +0300)
Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/da8xx-fb.c

index a8484f768d04e17f395db1a845b6bb4145ac118f..788f6b37fce703aec7ef08b91abd9c77d3fdd4e7 100644 (file)
@@ -1447,18 +1447,15 @@ static int fb_probe(struct platform_device *device)
                da8xx_fb_fix.line_length - 1;
 
        /* allocate palette buffer */
-       par->v_palette_base = dma_alloc_coherent(NULL,
-                                              PALETTE_SIZE,
-                                              (resource_size_t *)
-                                              &par->p_palette_base,
-                                              GFP_KERNEL | GFP_DMA);
+       par->v_palette_base = dma_zalloc_coherent(NULL, PALETTE_SIZE,
+                                                 (resource_size_t *)&par->p_palette_base,
+                                                 GFP_KERNEL | GFP_DMA);
        if (!par->v_palette_base) {
                dev_err(&device->dev,
                        "GLCD: kmalloc for palette buffer failed\n");
                ret = -EINVAL;
                goto err_release_fb_mem;
        }
-       memset(par->v_palette_base, 0, PALETTE_SIZE);
 
        par->irq = platform_get_irq(device, 0);
        if (par->irq < 0) {