1 diff -Nru zaptel-1.4.9.2.org/kernel/zaptel-base.c zaptel-1.4.9.2/kernel/zaptel-base.c
2 --- zaptel-1.4.9.2.org/kernel/zaptel-base.c 2008-02-28 20:00:47.000000000 +0100
3 +++ zaptel-1.4.9.2/kernel/zaptel-base.c 2008-11-29 16:01:23.000000000 +0100
5 /* udev necessary data structures. Yeah! */
8 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
9 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
10 +#define CLASS_DEV_CREATE(class, devt, device, name) \
11 + device_create(class, device, devt, NULL, "%s", name)
12 +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
13 +#define CLASS_DEV_CREATE(class, devt, device, name) \
14 + device_create(class, device, devt, name)
15 +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
16 #define CLASS_DEV_CREATE(class, devt, device, name) \
17 class_device_create(class, NULL, devt, device, name)
19 +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
20 #define CLASS_DEV_CREATE(class, devt, device, name) \
21 class_device_create(class, devt, device, name)
23 +#define CLASS_DEV_CREATE(class, devt, device, name) \
24 + class_simple_device_add(class, devt, device, name)
27 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
28 +#define CLASS_DEV_DESTROY(class, devt) \
29 + device_destroy(class, devt)
30 +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
31 +#define CLASS_DEV_DESTROY(class, devt) \
32 + class_device_destroy(class, devt)
34 +#define CLASS_DEV_DESTROY(class, devt) \
35 + class_simple_device_remove(class, devt)
38 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
40 static struct class_simple *zap_class = NULL;
41 #define class_create class_simple_create
42 #define class_destroy class_simple_destroy
43 -#define class_device_create class_simple_device_add
44 -#define class_device_destroy(a, b) class_simple_device_remove(b)
47 #endif /* CONFIG_ZAP_UDEV */
49 #ifdef CONFIG_ZAP_UDEV
50 for (x = 0; x < span->channels; x++) {
51 if (span->chans[x].channo < 250)
52 - class_device_destroy(zap_class, MKDEV(ZT_MAJOR, span->chans[x].channo));
53 + CLASS_DEV_DESTROY(zap_class, MKDEV(ZT_MAJOR, span->chans[x].channo));
55 #endif /* CONFIG_ZAP_UDEV */
58 int zt_unregister_chardev(struct zt_chardev *dev)
60 #ifdef CONFIG_ZAP_UDEV
61 - class_device_destroy(zap_class, MKDEV(ZT_MAJOR, dev->minor));
62 + CLASS_DEV_DESTROY(zap_class, MKDEV(ZT_MAJOR, dev->minor));
63 #endif /* CONFIG_ZAP_UDEV */
65 #ifdef CONFIG_DEVFS_FS
66 @@ -7434,10 +7452,10 @@
67 devfs_unregister_chrdev(ZT_MAJOR, "zaptel");
69 #ifdef CONFIG_ZAP_UDEV
70 - class_device_destroy(zap_class, MKDEV(ZT_MAJOR, 253)); /* timer */
71 - class_device_destroy(zap_class, MKDEV(ZT_MAJOR, 254)); /* channel */
72 - class_device_destroy(zap_class, MKDEV(ZT_MAJOR, 255)); /* pseudo */
73 - class_device_destroy(zap_class, MKDEV(ZT_MAJOR, 0)); /* ctl */
74 + CLASS_DEV_DESTROY(zap_class, MKDEV(ZT_MAJOR, 253)); /* timer */
75 + CLASS_DEV_DESTROY(zap_class, MKDEV(ZT_MAJOR, 254)); /* channel */
76 + CLASS_DEV_DESTROY(zap_class, MKDEV(ZT_MAJOR, 255)); /* pseudo */
77 + CLASS_DEV_DESTROY(zap_class, MKDEV(ZT_MAJOR, 0)); /* ctl */
78 class_destroy(zap_class);
79 #endif /* CONFIG_ZAP_UDEV */
80 unregister_chrdev(ZT_MAJOR, "zaptel");