Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 068f3047 authored by Souptick Joarder's avatar Souptick Joarder Committed by Daniel Vetter
Browse files

drm/drm_pci.c: Use dma_zalloc_coherent

parent 32e932e3
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -61,15 +61,14 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali
		return NULL;

	dmah->size = size;
	dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size, &dmah->busaddr, GFP_KERNEL | __GFP_COMP);
	dmah->vaddr = dma_zalloc_coherent(&dev->pdev->dev, size, &dmah->busaddr,
						GFP_KERNEL | __GFP_COMP);

	if (dmah->vaddr == NULL) {
		kfree(dmah);
		return NULL;
	}

	memset(dmah->vaddr, 0, size);

	/* XXX - Is virt_to_page() legal for consistent mem? */
	/* Reserve */
	for (addr = (unsigned long)dmah->vaddr, sz = size;