summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorRik Faith <faith@alephnull.com>2001-02-21 16:06:10 +0000
committerRik Faith <faith@alephnull.com>2001-02-21 16:06:10 +0000
commitc4a247d26228b2506fcb1c5cac2302a22e91219e (patch)
treec133781ce7a59136b0ff66918b21237dbe9cdb79 /linux-core
parent48768df6c3197dea8f68fc69795c5aa820ce5678 (diff)
Add Linux 2.2.x support for stubs
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_stub.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/linux-core/drm_stub.c b/linux-core/drm_stub.c
index a6a39d86..bc958796 100644
--- a/linux-core/drm_stub.c
+++ b/linux-core/drm_stub.c
@@ -31,6 +31,10 @@
#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 {
@@ -120,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 {