summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-11-05 18:31:10 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-11-05 18:31:10 +0000
commitff6d4cb72c4f34ae25925fd7c164c4bdfdc850a4 (patch)
treee6da777f03d69d8696680c743bc2c9a415f6a243
parent8e2324cd16740e41b579c8758d6c0c4e26e14c2c (diff)
don't fail the entire build process when HZ is not 1000, since the user may not be intending to use ztdummy anyway
if ztdummy is compiled with HZ != 1000, make the module load fail with an appropriate error message git-svn-id: http://svn.digium.com/svn/zaptel/trunk@808 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-xztdummy.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ztdummy.c b/ztdummy.c
index e24ae93..d15bd1f 100755
--- a/ztdummy.c
+++ b/ztdummy.c
@@ -100,7 +100,7 @@ static int debug = 0;
/* New 2.6 kernel timer stuff */
static struct timer_list timer;
#if HZ != 1000
-#error ztdummy requires 1000 hz jiffies
+#warning This module will not be usable since the kernel HZ setting is not 1000 ticks per second.
#endif
#endif
#else
@@ -220,6 +220,13 @@ int init_module(void)
}
#endif
+#if defined(LINUX26) && !defined(USE_RTC)
+ if (HZ != 1000) {
+ printk("ztdummy: This module requires the kernel HZ setting to be 1000 ticks per second\n");
+ return -ENODEV;
+ }
+#endif /* defined(LINUX26) && !defined(USE_RTC) */
+
ztd = kmalloc(sizeof(struct ztdummy), GFP_KERNEL);
if (ztd == NULL) {
printk("ztdummy: Unable to allocate memory\n");