summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/mach64_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/drm/mach64_dma.c')
-rw-r--r--sys/dev/pci/drm/mach64_dma.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/pci/drm/mach64_dma.c b/sys/dev/pci/drm/mach64_dma.c
index 339234fa830..1fd9e716920 100644
--- a/sys/dev/pci/drm/mach64_dma.c
+++ b/sys/dev/pci/drm/mach64_dma.c
@@ -1006,12 +1006,10 @@ static int mach64_do_dma_init(struct drm_device * dev, drm_mach64_init_t * init)
DRM_DEBUG("\n");
- dev_priv = drm_alloc(sizeof(drm_mach64_private_t), DRM_MEM_DRIVER);
+ dev_priv = drm_calloc(1, sizeof(drm_mach64_private_t), DRM_MEM_DRIVER);
if (dev_priv == NULL)
return -ENOMEM;
- memset(dev_priv, 0, sizeof(drm_mach64_private_t));
-
dev_priv->is_pci = init->is_pci;
dev_priv->fb_bpp = init->fb_bpp;
@@ -1477,10 +1475,9 @@ int mach64_init_freelist(struct drm_device * dev)
for (i = 0; i < dma->buf_count; i++) {
if ((entry =
(drm_mach64_freelist_t *)
- drm_alloc(sizeof(drm_mach64_freelist_t),
+ drm_calloc(1, sizeof(drm_mach64_freelist_t),
DRM_MEM_BUFLISTS)) == NULL)
return -ENOMEM;
- memset(entry, 0, sizeof(drm_mach64_freelist_t));
entry->buf = dma->buflist[i];
ptr = &entry->list;
list_add_tail(ptr, &dev_priv->free_list);