extern drm_dma_handle_t *drm_pci_alloc(drm_device_t * dev, size_t size,
size_t align, dma_addr_t maxaddr);
+extern void __drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah);
extern void drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah);
/* sysfs support (drm_sysfs.c) */
}
map->handle = dmah->vaddr;
map->offset = (unsigned long)dmah->busaddr;
+ kfree(dmah);
break;
}
default:
dmah.vaddr = map->handle;
dmah.busaddr = map->offset;
dmah.size = map->size;
- drm_pci_free(dev, &dmah);
+ __drm_pci_free(dev, &dmah);
break;
}
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
dmah.vaddr = map->handle;
dmah.busaddr = map->offset;
dmah.size = map->size;
- drm_pci_free(dev, &dmah);
+ __drm_pci_free(dev, &dmah);
break;
}
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
EXPORT_SYMBOL(drm_pci_alloc);
/**
- * \brief Free a PCI consistent memory block.
+ * \brief 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_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah)
+__drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah)
{
#if 0
unsigned long addr;
#endif
}
+
+/**
+ * \brief Free a PCI consistent memory block.
+ */
+void
+drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah)
+{
+ __drm_pci_free(dev, dmah);
+ kfree(dmah);
+}
EXPORT_SYMBOL(drm_pci_free);
/*@}*/
dmah.vaddr = map->handle;
dmah.busaddr = map->offset;
dmah.size = map->size;
- drm_pci_free(dev, &dmah);
+ __drm_pci_free(dev, &dmah);
break;
}
drm_free(map, sizeof(*map), DRM_MEM_MAPS);