From ff6d4cb72c4f34ae25925fd7c164c4bdfdc850a4 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Sat, 5 Nov 2005 18:31:10 +0000 Subject: 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 --- ztdummy.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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"); -- cgit v1.2.3