diff options
author | Jon Smirl <jonsmirl@yahoo.com> | 2004-10-23 04:21:27 +0000 |
---|---|---|
committer | Jon Smirl <jonsmirl@yahoo.com> | 2004-10-23 04:21:27 +0000 |
commit | 9ea6fe7aa6ba27cc7003c9cd141e9146a492416d (patch) | |
tree | 96f7d7871f782a5ed8932194aca0a62c89f06e13 /linux-core/drm_drv.c | |
parent | ad87dd8427b6142c42d7b97c7a4170c89b6728ec (diff) |
Prepare to eliminate inter_module_get("agp")
Diffstat (limited to 'linux-core/drm_drv.c')
-rw-r--r-- | linux-core/drm_drv.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index b59b5ca5..7673aaa3 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -463,6 +463,8 @@ static struct file_operations drm_stub_fops = { .open = drm_stub_open }; +static int use_inter_module = 0; + static int __init drm_core_init(void) { int ret = -ENOMEM; @@ -489,7 +491,12 @@ static int __init drm_core_init(void) ret = -1; goto err_p3; } - drm_agp = (drm_agp_t *) inter_module_get("drm_agp"); + drm_agp = symbol_get(drm_agp_entry); + if (!drm_agp) { + drm_agp = inter_module_get("agp"); + use_inter_module = 1; + } + DRM_DEBUG("drm_agp %p\n", drm_agp); DRM_INFO("Initialized %s %d.%d.%d %s\n", DRIVER_NAME, @@ -506,9 +513,12 @@ err_p1: static void __exit drm_core_exit(void) { - if (drm_agp) - inter_module_put("drm_agp"); - + if (drm_agp) { + if (use_inter_module) + inter_module_put("agp"); + else + symbol_put(drm_agp_entry); + } remove_proc_entry("dri", NULL); drm_sysfs_destroy(drm_class); |