From ac88d4096d36c2bc10bb95fc8a289bf33b038259 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 18 May 2007 16:21:20 +0000 Subject: 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 --- zaptel.c | 9 ++++++--- 1 file 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 */ -- cgit v1.2.3