diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-06-22 13:10:28 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-06-22 13:10:28 +0000 |
commit | 50f029d83c725624378b16f9dd6467a424f166ed (patch) | |
tree | ffdfdfd2c2452fcd7cace7b7b933b9e803e98b0a /drivers | |
parent | c1cf9f809b20490f1ec35b67b22d7086586a6527 (diff) |
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.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4446 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index feb1f53..f9c011d 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -7643,17 +7643,17 @@ static int __init dahdi_init(void) { 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); dahdi_conv_init(); |