From 0bff0d9eb6317ccccafc79cac7b235b4cb4c9161 Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Tue, 28 Sep 2004 22:25:06 +0000 Subject: Getting the AGP module is a global resource. Make sure a dual PCI/AGP driver doesn't release it on unload since an AGP driver may also be loaded. --- linux-core/drm_drv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'linux-core/drm_drv.c') diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 425320b1..669b1a25 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -608,7 +608,6 @@ static void __exit drm_cleanup( drm_device_t *dev ) } if (drm_core_has_AGP(dev) && dev->agp ) { - drm_agp_uninit(); drm_free( dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS ); dev->agp = NULL; } @@ -670,7 +669,7 @@ static int __init drm_core_init(void) ret = -1; goto err_p3; } - DRM_DEBUG("calling inter_module_register\n"); + drm_agp = (drm_agp_t *)inter_module_get("drm_agp"); DRM_INFO( "Initialized %s %d.%d.%d %s\n", DRIVER_NAME, @@ -691,6 +690,9 @@ err_p1: static void __exit drm_core_exit (void) { + if (drm_agp) + inter_module_put("drm_agp"); + remove_proc_entry("dri", NULL); drm_sysfs_destroy(drm_class); -- cgit v1.2.3