summaryrefslogtreecommitdiff
blob: f1621a0433a5438bb2de73e34a7b962e470221cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Index: mISDN/udevice.c
===================================================================
RCS file: /i4ldev/mISDN/drivers/isdn/hardware/mISDN/udevice.c,v
retrieving revision 1.20
diff -u -r1.20 udevice.c
--- mISDN/udevice.c	12 May 2006 13:27:23 -0000	1.20
+++ mISDN/udevice.c	18 Jul 2006 11:00:55 -0000
@@ -10,7 +10,13 @@
 #include <linux/vmalloc.h>
 #include <linux/config.h>
 #include <linux/timer.h>
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#define HAVE_DEVFS 1
 #include <linux/devfs_fs_kernel.h>
+#else
+#define HAVE_DEVFS 0
+#endif
 #include "core.h"
 
 #define MAX_HEADER_LEN	4
@@ -1983,8 +1989,11 @@
 	if (err) {
 		printk(KERN_ERR "Can't register %s error(%d)\n", MName, err);
 		unregister_chrdev(mISDN_MAJOR, "mISDN");
-	} else
+	} else {
+#if HAVE_DEVFS
 		devfs_mk_cdev(MKDEV(mISDN_MAJOR, 0), S_IFCHR | S_IRUSR | S_IWUSR, "mISDN");
+#endif
+	}
 
 	return(err);
 }
@@ -2006,6 +2015,8 @@
 	if ((err = unregister_chrdev(mISDN_MAJOR, "mISDN"))) {
 		printk(KERN_WARNING "mISDN: devices busy on remove\n");
 	}
+#if HAVE_DEVFS
 	devfs_remove("mISDN");
+#endif
 	return(err);
 }