diff options
author | russell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-12-02 00:00:28 +0000 |
---|---|---|
committer | russell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-12-02 00:00:28 +0000 |
commit | b8a3a6237d1c3b064db52fb8a20ad2123f760a89 (patch) | |
tree | 9edd913602b45cd8213ac9f9084eef5dd98ff931 /zaptel.c | |
parent | ea32294ab39710f6678fa9532fa52b7b27037160 (diff) |
fix udev support for 2.6.15 (issue #5891)
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@842 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.c')
-rw-r--r-- | zaptel.c | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -157,6 +157,15 @@ static devfs_handle_t timer; /* udev necessary data structures. Yeah! */ #ifdef CONFIG_ZAP_UDEV + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) +#define CLASS_DEV_CREATE(class, devt, device, name) \ + class_device_create(class, NULL, devt, device, name) +#else +#define CLASS_DEV_CREATE(class, devt, device, name) \ + class_device_create(class, devt, device, name) +#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) static struct class *zap_class = NULL; #else @@ -166,7 +175,9 @@ static struct class_simple *zap_class = NULL; #define class_device_create class_simple_device_add #define class_device_destroy(a, b) class_simple_device_remove(b) #endif -#endif + +#endif /* CONFIG_ZAP_UDEV */ + /* There is a table like this in the PPP driver, too */ @@ -4445,7 +4456,7 @@ int zt_register(struct zt_span *span, int prefmaster) for (x = 0; x < span->channels; x++) { char chan_name[50]; sprintf(chan_name, "zap%d", span->chans[x].channo); - class_device_create(zap_class, MKDEV(ZT_MAJOR, span->chans[x].channo), NULL, chan_name); + CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, span->chans[x].channo), NULL, chan_name); } #endif /* CONFIG_ZAP_UDEV */ @@ -6504,10 +6515,10 @@ static int __init zt_init(void) { #ifdef CONFIG_ZAP_UDEV /* udev support functions */ zap_class = class_create(THIS_MODULE, "zaptel"); - class_device_create(zap_class, MKDEV(ZT_MAJOR, 253), NULL, "zaptimer"); - class_device_create(zap_class, MKDEV(ZT_MAJOR, 254), NULL, "zapchannel"); - class_device_create(zap_class, MKDEV(ZT_MAJOR, 255), NULL, "zappseudo"); - class_device_create(zap_class, MKDEV(ZT_MAJOR, 0), NULL, "zapctl"); + CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, 253), NULL, "zaptimer"); + CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, 254), NULL, "zapchannel"); + CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, 255), NULL, "zappseudo"); + CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, 0), NULL, "zapctl"); #endif /* CONFIG_ZAP_UDEV */ #ifdef CONFIG_DEVFS_FS |