[svn-commits] tzafrir: branch 1.2 r4509 - /branches/1.2/zaptel-base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Sep 3 12:55:25 CDT 2008


Author: tzafrir
Date: Wed Sep  3 12:55:24 2008
New Revision: 4509

URL: http://svn.digium.com/view/zaptel?view=rev&rev=4509
Log:
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).

Modified:
    branches/1.2/zaptel-base.c

Modified: branches/1.2/zaptel-base.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/zaptel-base.c?view=diff&rev=4509&r1=4508&r2=4509
==============================================================================
--- branches/1.2/zaptel-base.c (original)
+++ branches/1.2/zaptel-base.c Wed Sep  3 12:55:24 2008
@@ -6757,19 +6757,6 @@
 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;
@@ -6788,6 +6775,19 @@
 		return res;
 	}
 #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);




More information about the svn-commits mailing list