summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-09-03 18:52:46 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-09-03 18:52:46 +0000
commit3fe6c88543738151dcf420903ad151aadf0f1b82 (patch)
tree6a08a60c9d88f61b0cb4da7556378c7fdbdd8338
parent21dfaa664c24287fd101d913c0b1b713f23de980 (diff)
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). Merged revisions 4509 via svnmerge from http://svn.digium.com/svn/zaptel/branches/1.2 git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4511 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--kernel/zaptel-base.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/kernel/zaptel-base.c b/kernel/zaptel-base.c
index d2e5eb7..dedf4c4 100644
--- a/kernel/zaptel-base.c
+++ b/kernel/zaptel-base.c
@@ -7736,18 +7736,6 @@ int zt_unregister_chardev(struct zt_chardev *dev)
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, 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;
@@ -7767,6 +7755,18 @@ 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, 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();