Prepare to eliminate inter_module_get("agp")
authorJon Smirl <jonsmirl@yahoo.com>
Sat, 23 Oct 2004 04:21:27 +0000 (04:21 +0000)
committerJon Smirl <jonsmirl@yahoo.com>
Sat, 23 Oct 2004 04:21:27 +0000 (04:21 +0000)
linux-core/drm_drv.c
linux-core/drm_stub.c
linux-core/radeon_i2c.c

index b59b5ca..7673aaa 100644 (file)
@@ -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);
 
index c927705..cc1488f 100644 (file)
@@ -47,7 +47,7 @@ MODULE_PARM_DESC(cards_limit, "Maximum number of graphics cards");
 MODULE_PARM_DESC(drm_debug, "Enable debug output");
 
 module_param(cards_limit, int, S_IRUGO);
-module_param(drm_debug, int, S_IRUGO|S_IWUGO);
+module_param_named(debug, drm_debug, int, S_IRUGO|S_IWUGO);
 
 drm_head_t **drm_heads;
 struct drm_sysfs_class *drm_class;
index df369d6..e19ea18 100644 (file)
@@ -134,6 +134,8 @@ int radeon_create_i2c_busses(drm_device_t * dev)
        dev_priv->i2c[3].ddc_reg = GPIO_CRT2_DDC;
        setup_i2c_bus(dev, &dev_priv->i2c[3], "crt2");
 
+       request_module("eeprom");
+
        return 0;
 }