drm: Remove the dma_alloc_coherent wrapper for internal usage
Internally for "consistent" maps, we create a temporary struct drm_dma_handle in order to use our own dma_alloc_coherent wrapper then destroy the temporary wrap. Simplify our logic by removing the temporary wrapper! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200202171635.4039044-2-chris@chris-wilson.co.uk
This commit is contained in:
@@ -78,18 +78,6 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali
|
||||
|
||||
EXPORT_SYMBOL(drm_pci_alloc);
|
||||
|
||||
/*
|
||||
* Free a PCI consistent memory block without freeing its descriptor.
|
||||
*
|
||||
* This function is for internal use in the Linux-specific DRM core code.
|
||||
*/
|
||||
void __drm_legacy_pci_free(struct drm_device * dev, drm_dma_handle_t * dmah)
|
||||
{
|
||||
if (dmah->vaddr)
|
||||
dma_free_coherent(&dev->pdev->dev, dmah->size, dmah->vaddr,
|
||||
dmah->busaddr);
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_pci_free - Free a PCI consistent memory block
|
||||
* @dev: DRM device
|
||||
@@ -100,7 +88,8 @@ void __drm_legacy_pci_free(struct drm_device * dev, drm_dma_handle_t * dmah)
|
||||
*/
|
||||
void drm_pci_free(struct drm_device * dev, drm_dma_handle_t * dmah)
|
||||
{
|
||||
__drm_legacy_pci_free(dev, dmah);
|
||||
dma_free_coherent(&dev->pdev->dev, dmah->size, dmah->vaddr,
|
||||
dmah->busaddr);
|
||||
kfree(dmah);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user