summaryrefslogtreecommitdiff
path: root/linux/drm_stub.h
diff options
context:
space:
mode:
authorKevin E Martin <kem@kem.org>2001-03-07 21:47:43 +0000
committerKevin E Martin <kem@kem.org>2001-03-07 21:47:43 +0000
commit5d66ea4fb42214c09449bb4a45c359440757ae5c (patch)
treee7baf1af0f35b1e1277d2cb535390a31c7d4de20 /linux/drm_stub.h
parent7e820fc7d89d06a11f448d7093469a0c765a84a6 (diff)
- Merge from trunk into branchsarea-1-0-0-20010307
Diffstat (limited to 'linux/drm_stub.h')
-rw-r--r--linux/drm_stub.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/linux/drm_stub.h b/linux/drm_stub.h
index ed37af4d..bc958796 100644
--- a/linux/drm_stub.h
+++ b/linux/drm_stub.h
@@ -1,4 +1,4 @@
-/* drm_stub.c -- -*- linux-c -*-
+/* drm_stub.h -- -*- linux-c -*-
* Created: Fri Jan 19 10:48:35 2001 by faith@acm.org
*
* Copyright 2001 VA Linux Systems, Inc., Sunnyvale, California.
@@ -28,6 +28,13 @@
*
*/
+#define __NO_VERSION__
+#include "drmP.h"
+
+#if LINUX_VERSION_CODE < 0x020400
+#include "stubsupport-pre24.h"
+#endif
+
#define DRM_STUB_MAXCARDS 16 /* Enough for one machine */
static struct drm_stub_list {
@@ -58,7 +65,7 @@ static int DRM(stub_open)(struct inode *inode, struct file *filp)
filp->f_op = fops_get(old_fops);
}
fops_put(old_fops);
-
+
return err;
}
@@ -73,7 +80,7 @@ static int DRM(stub_getminor)(const char *name, struct file_operations *fops,
drm_device_t *dev)
{
int i;
-
+
if (!DRM(stub_list)) {
DRM(stub_list) = DRM(alloc)(sizeof(*DRM(stub_list))
* DRM_STUB_MAXCARDS, DRM_MEM_STUB);
@@ -117,10 +124,13 @@ static int DRM(stub_putminor)(int minor)
int DRM(stub_register)(const char *name, struct file_operations *fops,
drm_device_t *dev)
{
- if (register_chrdev(DRM_MAJOR, "drm", &DRM(stub_fops))) {
- /* Already registered */
- struct drm_stub_info *i;
+ struct drm_stub_info *i = NULL;
+
+ if (register_chrdev(DRM_MAJOR, "drm", &DRM(stub_fops)))
i = (struct drm_stub_info *)inter_module_get("drm");
+
+ if (i) {
+ /* Already registered */
DRM(stub_info).info_register = i->info_register;
DRM(stub_info).info_unregister = i->info_unregister;
} else {