[dahdi-commits] tzafrir: linux/trunk r4446 - /linux/trunk/drivers/dahdi/dahdi-base.c

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Sun Jun 22 08:10:29 CDT 2008


Author: tzafrir
Date: Sun Jun 22 08:10:28 2008
New Revision: 4446

URL: http://svn.digium.com/view/dahdi?view=rev&rev=4446
Log:
Slightly better error hadling: if we failed to register a major device
type, don't create pointless files in /sys that will oops on remove.

Modified:
    linux/trunk/drivers/dahdi/dahdi-base.c

Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=4446&r1=4445&r2=4446
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Sun Jun 22 08:10:28 2008
@@ -7643,16 +7643,16 @@
 	proc_entries[0] = proc_mkdir("dahdi", NULL);
 #endif
 
+	if ((res = register_chrdev(DAHDI_MAJOR, "dahdi", &dahdi_fops))) {
+		module_printk(KERN_ERR, "Unable to register DAHDI character device handler on %d\n", DAHDI_MAJOR);
+		return res;
+	}
+
 	dahdi_class = class_create(THIS_MODULE, "dahdi");
 	CLASS_DEV_CREATE(dahdi_class, MKDEV(DAHDI_MAJOR, 253), NULL, "dahditimer");
 	CLASS_DEV_CREATE(dahdi_class, MKDEV(DAHDI_MAJOR, 254), NULL, "dahdichannel");
 	CLASS_DEV_CREATE(dahdi_class, MKDEV(DAHDI_MAJOR, 255), NULL, "dahdipseudo");
 	CLASS_DEV_CREATE(dahdi_class, MKDEV(DAHDI_MAJOR, 0), NULL, "dahdictl");
-
-	if ((res = register_chrdev(DAHDI_MAJOR, "dahdi", &dahdi_fops))) {
-		module_printk(KERN_ERR, "Unable to register DAHDI character device handler on %d\n", DAHDI_MAJOR);
-		return res;
-	}
 
 	module_printk(KERN_INFO, "Telephony Interface Registered on major %d\n", DAHDI_MAJOR);
 	module_printk(KERN_INFO, "Version: %s\n", DAHDI_VERSION);




More information about the dahdi-commits mailing list