From 9d559f9ce1ab32c7934aeadc19355d767cf0cc38 Mon Sep 17 00:00:00 2001 From: Abraham van der Merwe Date: Mon, 15 Jul 2002 10:08:40 +0000 Subject: [PATCH] Only use __exit in 2.4.xx and later kernels. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1457 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/ds1307.c | 9 +++++++++ kernel/chips/lm92.c | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/kernel/chips/ds1307.c b/kernel/chips/ds1307.c index 2f1f40b2..be3d6ac3 100644 --- a/kernel/chips/ds1307.c +++ b/kernel/chips/ds1307.c @@ -317,12 +317,16 @@ static int ds1307_command (struct i2c_client *client,unsigned int cmd,void *arg) static void ds1307_inc_use (struct i2c_client *client) { +#ifdef MODULE MOD_INC_USE_COUNT; +#endif /* #ifdef MODULE */ } static void ds1307_dec_use (struct i2c_client *client) { +#ifdef MODULE MOD_DEC_USE_COUNT; +#endif /* #ifdef MODULE */ } static struct i2c_driver ds1307 = { @@ -348,6 +352,11 @@ static int __init ds1307_init (void) return (0); } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) +#undef __exit +#define __exit +#endif /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */ + static void __exit ds1307_exit (void) { i2c_del_driver (&ds1307); diff --git a/kernel/chips/lm92.c b/kernel/chips/lm92.c index 2cf6f304..784c1cc3 100644 --- a/kernel/chips/lm92.c +++ b/kernel/chips/lm92.c @@ -406,6 +406,11 @@ static int __init sensors_lm92_init (void) return (0); } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) +#undef __exit +#define __exit +#endif /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */ + static void __exit sensors_lm92_exit (void) { i2c_del_driver (&lm92_driver);