summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-05-18 16:21:20 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-05-18 16:21:20 +0000
commitac88d4096d36c2bc10bb95fc8a289bf33b038259 (patch)
treebcaeeff4300e347e99658bc6cff194c1b593cacf
parentb01340f8b1b9d5fbe4a65f56bc84bd07ca618c14 (diff)
Let's not overload our minor numbers. Fixes error on unload on systems with more than 250 devices.
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2542 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--zaptel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/zaptel.c b/zaptel.c
index 606deb1..814cb30 100644
--- a/zaptel.c
+++ b/zaptel.c
@@ -4720,8 +4720,10 @@ int zt_register(struct zt_span *span, int prefmaster)
#ifdef CONFIG_ZAP_UDEV
for (x = 0; x < span->channels; x++) {
char chan_name[50];
- sprintf(chan_name, "zap%d", span->chans[x].channo);
- CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, span->chans[x].channo), NULL, chan_name);
+ if (span->chans[x].channo < 250) {
+ sprintf(chan_name, "zap%d", span->chans[x].channo);
+ CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, span->chans[x].channo), NULL, chan_name);
+ }
}
#endif /* CONFIG_ZAP_UDEV */
@@ -4774,7 +4776,8 @@ int zt_unregister(struct zt_span *span)
#ifdef CONFIG_ZAP_UDEV
for (x = 0; x < span->channels; x++) {
- class_device_destroy(zap_class, MKDEV(ZT_MAJOR, span->chans[x].channo));
+ if (span->chans[x].channo < 250)
+ class_device_destroy(zap_class, MKDEV(ZT_MAJOR, span->chans[x].channo));
}
#endif /* CONFIG_ZAP_UDEV */