diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-04-12 13:56:00 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-04-12 13:56:00 +0000 |
commit | 56dfab7d84b243c6ba045f42d898bd29215413cb (patch) | |
tree | 2ed66342f72a2cae0759231aa6e1e4e147091843 /sys/dev/pci/drm/drm_drv.c | |
parent | a73334e9bdae2e7afd3a9ce357cbdd66192dbbd7 (diff) |
Convert the list of agp memory over to a TAILQ instead of using a hand-
rolled list.
Tested by many
Diffstat (limited to 'sys/dev/pci/drm/drm_drv.c')
-rw-r--r-- | sys/dev/pci/drm/drm_drv.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index 390d54d73da..d72c71adb74 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -446,20 +446,18 @@ drm_lastclose(drm_device_t *dev) /* Clear AGP information */ if ( dev->agp ) { - drm_agp_mem_t *entry; - drm_agp_mem_t *nexte; + struct drm_agp_mem *entry; /* Remove AGP resources, but leave dev->agp intact until * drm_unload is called. */ - for ( entry = dev->agp->memory ; entry ; entry = nexte ) { - nexte = entry->next; + while ((entry = TAILQ_FIRST(&dev->agp->memory)) != NULL) { if ( entry->bound ) drm_agp_unbind_memory(entry->handle); drm_agp_free_memory(entry->handle); + TAILQ_REMOVE(&dev->agp->memory, entry, link); free(entry, M_DRM); } - dev->agp->memory = NULL; if (dev->agp->acquired) drm_agp_release(dev); |