diff options
author | Dave Airlie <airlied@linux.ie> | 2007-05-26 04:26:24 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2007-05-26 04:26:24 +1000 |
commit | 7b48f0022a24bc5f565ae64b450dda77dee616c1 (patch) | |
tree | befe9424d3da96b792edce5ee0d2c2594f4273b7 /linux-core/drm_stub.c | |
parent | ea98d7e79657469545b865a353784d79fc8cff9d (diff) |
drm: cleanup use of Linux list handling macros
This makes the drms use of the list handling macros a lot cleaner
and more along the lines of how they should be used.
Diffstat (limited to 'linux-core/drm_stub.c')
-rw-r--r-- | linux-core/drm_stub.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/linux-core/drm_stub.c b/linux-core/drm_stub.c index f4da7dac0..bcbabf8d0 100644 --- a/linux-core/drm_stub.c +++ b/linux-core/drm_stub.c @@ -60,6 +60,7 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev, { int retcode; + INIT_LIST_HEAD(&dev->filelist); spin_lock_init(&dev->count_lock); spin_lock_init(&dev->drw_lock); spin_lock_init(&dev->tasklet_lock); @@ -80,27 +81,21 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev, dev->irq = pdev->irq; if (drm_ht_create(&dev->map_hash, DRM_MAP_HASH_ORDER)) { - drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS); return -ENOMEM; } if (drm_mm_init(&dev->offset_manager, DRM_FILE_PAGE_OFFSET_START, DRM_FILE_PAGE_OFFSET_SIZE)) { - drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS); drm_ht_remove(&dev->map_hash); return -ENOMEM; } if (drm_ht_create(&dev->object_hash, DRM_OBJECT_HASH_ORDER)) { - drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS); drm_ht_remove(&dev->map_hash); drm_mm_takedown(&dev->offset_manager); return -ENOMEM; } - dev->maplist = drm_calloc(1, sizeof(*dev->maplist), DRM_MEM_MAPS); - if (dev->maplist == NULL) - return -ENOMEM; - INIT_LIST_HEAD(&dev->maplist->head); + INIT_LIST_HEAD(&dev->maplist); /* the DRM has 6 counters */ dev->counters = 6; |