if ( dev_priv->head != NULL ) { mga_freelist_cleanup( dev ); 
if ((dev_priv->primary != NULL) && (dev_priv->primary->type != _DRM_CONSISTENT)) drm_core_ioremapfree(dev_priv->primary, dev);  if (dev->agp_buffer_map != NULL) drm_core_ioremapfree(dev->agp_buffer_map, dev);  if (dev_priv->used_new_dma_init) { if (dev_priv->agp_mem != NULL) { dev_priv->agp_textures = NULL; drm_unbind_agp(dev_priv->agp_mem);  drm_free_agp(dev_priv->agp_mem, dev_priv->agp_pages); dev_priv->agp_pages = 0; dev_priv->agp_mem = NULL; }  if ((dev->agp != NULL) && dev->agp->acquired) { err = drm_agp_release(dev); }  dev_priv->used_new_dma_init = 0; 
static int mga_do_cleanup_dma( drm_device_t *dev ){	DRM_DEBUG( "\n" );	/* Make sure interrupts are disabled here because the uninstall ioctl	 * may not have been called from userspace and after dev_private	 * is freed, it's too late.	 */	if ( dev->irq_enabled ) drm_irq_uninstall(dev);	if ( dev->dev_private ) {		drm_mga_private_t *dev_priv = dev->dev_private;		if ( dev_priv->warp != NULL )			drm_core_ioremapfree( dev_priv->warp, dev );		if ( dev_priv->primary != NULL )			drm_core_ioremapfree( dev_priv->primary, dev );		if ( dev->agp_buffer_map != NULL )			drm_core_ioremapfree( dev->agp_buffer_map, dev );		if ( dev_priv->head != NULL ) {			mga_freelist_cleanup( dev );		}		drm_free( dev->dev_private, sizeof(drm_mga_private_t),			   DRM_MEM_DRIVER );		dev->dev_private = NULL;	}	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/6795c985a648d1e90b367cc1387c18205ecca4b8/mga_dma.c/clean/drivers/char/drm/mga_dma.c