From 0294f219f72954feb54499c984e704b956ac900b Mon Sep 17 00:00:00 2001 From: tzafrir Date: Wed, 3 Sep 2008 17:55:24 +0000 Subject: Before creating a device, register the major number. Otherwise we need to clean-up those devices in case of failure, and we don't. This fixes the case of accidentally loading zaptel after loading dahdi (Already fixed in DAHDI). git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@4509 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- zaptel-base.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/zaptel-base.c b/zaptel-base.c index f06ee9a..9323aae 100644 --- a/zaptel-base.c +++ b/zaptel-base.c @@ -6757,19 +6757,6 @@ static void __exit watchdog_cleanup(void) static int __init zt_init(void) { int res = 0; -#ifdef CONFIG_PROC_FS - proc_entries[0] = proc_mkdir("zaptel", NULL); -#endif - -#ifdef CONFIG_ZAP_UDEV /* udev support functions */ - zap_class = class_create(THIS_MODULE, "zaptel"); - CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, 250), NULL, "zaptranscode"); - 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 { umode_t mode = S_IFCHR|S_IRUGO|S_IWUGO; @@ -6789,6 +6776,19 @@ static int __init zt_init(void) { } #endif /* CONFIG_DEVFS_FS */ +#ifdef CONFIG_PROC_FS + proc_entries[0] = proc_mkdir("zaptel", NULL); +#endif + +#ifdef CONFIG_ZAP_UDEV /* udev support functions */ + zap_class = class_create(THIS_MODULE, "zaptel"); + CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, 250), NULL, "zaptranscode"); + 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 */ + printk(KERN_INFO "Zapata Telephony Interface Registered on major %d\n", ZT_MAJOR); printk(KERN_INFO "Zaptel Version: %s\n", ZAPTEL_VERSION); echo_can_init(); -- cgit v1.2.3