From: khali@linux-fr.org (Jean Delvare)
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
LM Sensors <sensors@stimpy.netroedge.com>
Subject: [PATCH 2.4] i2c cleanups, second wave (2/5)
Date: Thu, 19 May 2005 06:24:31 +0000 [thread overview]
Message-ID: <20031224233210.4573f541.khali@linux-fr.org> (raw)
In-Reply-To: <20031224225707.749707e5.khali@linux-fr.org>
This patch drops almost all compatibility stuff that was leftover from
times of kernel 2.2. A few extra includes may have survived, we will
take care of them later.
Most of the work was done by Ky?sti M?lkki. Original comment follows:
***
Remove code for KERNEL_VERSION tests.
***
Note that this patch was voluntarily generated using diff -U1, because
it contains only removals, so much context isn't required. Doing so
makes this patch apply successfully even if you don't apply the patch #1
of this second wave first.
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-adap-ite.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-adap-ite.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-adap-ite.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-adap-ite.c Tue Dec 23 19:02:05 2003
@@ -40,3 +40,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
@@ -63,7 +62,3 @@
static struct iic_ite gpi;
-#if (LINUX_VERSION_CODE < 0x020301)
-static struct wait_queue *iic_wait = NULL;
-#else
static wait_queue_head_t iic_wait;
-#endif
static int iic_pending;
@@ -273,5 +268,2 @@
iic_ite_data.data = (void *)piic;
-#if (LINUX_VERSION_CODE >= 0x020301)
- init_waitqueue_head(&iic_wait);
-#endif
if (iic_hw_resrc_init() = 0) {
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-algo-bit.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-bit.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-algo-bit.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-bit.c Tue Dec 23 19:02:05 2003
@@ -29,3 +29,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-algo-ite.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-ite.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-algo-ite.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-ite.c Tue Dec 23 19:02:05 2003
@@ -40,3 +40,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-algo-pcf.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-pcf.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-algo-pcf.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-pcf.c Tue Dec 23 19:02:05 2003
@@ -33,3 +33,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-core.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-core.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-core.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-core.c Tue Dec 23 19:02:05 2003
@@ -35,9 +35,4 @@
-#include <linux/version.h>
#include <linux/init.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)
-#define init_MUTEX(s) do { *(s) = MUTEX; } while(0)
-#endif
-
#include <asm/uaccess.h>
@@ -86,6 +81,2 @@
-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,27))
-static void monitor_bus_i2c(struct inode *inode, int fill);
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */
-
static ssize_t i2cproc_bus_read(struct file * file, char * buf,size_t count,
@@ -101,8 +92,2 @@
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,48))
-static struct inode_operations i2cproc_inode_operations = {
- &i2cproc_operations
-};
-#endif
-
static int i2cproc_initialized = 0;
@@ -166,12 +151,4 @@
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,48))
proc_entry->proc_fops = &i2cproc_operations;
-#else
- proc_entry->ops = &i2cproc_inode_operations;
-#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27))
proc_entry->owner = THIS_MODULE;
-#else
- proc_entry->fill_inode = &monitor_bus_i2c;
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */
adap->inode = proc_entry->low_ino;
@@ -613,14 +590,2 @@
-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,27))
-/* Monitor access to /proc/bus/i2c*; make unloading i2c-proc impossible
- if some process still uses it or some file in it */
-void monitor_bus_i2c(struct inode *inode, int fill)
-{
- if (fill)
- MOD_INC_USE_COUNT;
- else
- MOD_DEC_USE_COUNT;
-}
-#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,37)) */
-
/* This function generates the output for /proc/bus/i2c */
@@ -734,7 +699,3 @@
proc_bus_i2c->read_proc = &read_bus_i2c;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27))
proc_bus_i2c->owner = THIS_MODULE;
-#else
- proc_bus_i2c->fill_inode = &monitor_bus_i2c;
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27)) */
i2cproc_initialized += 2;
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-dev.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-dev.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-dev.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-dev.c Tue Dec 23 19:02:05 2003
@@ -37,6 +37,3 @@
#include <linux/slab.h>
-#include <linux/version.h>
-#if LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0)
#include <linux/smp_lock.h>
-#endif /* LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0) */
#ifdef CONFIG_DEVFS_FS
@@ -57,5 +54,2 @@
-#if LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,9)
-static loff_t i2cdev_lseek (struct file *file, loff_t offset, int origin);
-#endif
static ssize_t i2cdev_read (struct file *file, char *buf, size_t count,
@@ -79,10 +73,4 @@
static struct file_operations i2cdev_fops = {
-#if LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0)
owner: THIS_MODULE,
-#endif /* LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0) */
-#if LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,9)
- llseek: i2cdev_lseek,
-#else
llseek: no_llseek,
-#endif
read: i2cdev_read,
@@ -124,16 +112,2 @@
-#if LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,9)
-/* Note that the lseek function is called llseek in 2.1 kernels. But things
- are complicated enough as is. */
-loff_t i2cdev_lseek (struct file *file, loff_t offset, int origin)
-{
-#ifdef DEBUG
- struct inode *inode = file->f_dentry->d_inode;
- printk("i2c-dev.o: i2c-%d lseek to %ld bytes relative to %d.\n",
- MINOR(inode->i_rdev),(long) offset,origin);
-#endif /* DEBUG */
- return -ESPIPE;
-}
-#endif
-
static ssize_t i2cdev_read (struct file *file, char *buf, size_t count,
@@ -425,5 +399,2 @@
i2cdev_adaps[minor]->inc_use(i2cdev_adaps[minor]);
-#if LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,0)
- MOD_INC_USE_COUNT;
-#endif /* LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,0) */
@@ -443,12 +414,6 @@
#endif
-#if LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,0)
- MOD_DEC_USE_COUNT;
-#else /* LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0) */
lock_kernel();
-#endif /* LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,0) */
if (i2cdev_adaps[minor]->dec_use)
i2cdev_adaps[minor]->dec_use(i2cdev_adaps[minor]);
-#if LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0)
unlock_kernel();
-#endif /* LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0) */
return 0;
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-elektor.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-elektor.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-elektor.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-elektor.c Tue Dec 23 19:02:05 2003
@@ -32,3 +32,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
@@ -57,7 +56,3 @@
-#if (LINUX_VERSION_CODE < 0x020301)
-static struct wait_queue *pcf_wait = NULL;
-#else
static wait_queue_head_t pcf_wait;
-#endif
static int pcf_pending;
@@ -270,5 +265,3 @@
-#if (LINUX_VERSION_CODE >= 0x020301)
init_waitqueue_head(&pcf_wait);
-#endif
if (pcf_isa_init() = 0) {
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-elv.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-elv.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-elv.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-elv.c Tue Dec 23 19:02:05 2003
@@ -29,3 +29,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-keywest.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-keywest.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-keywest.c Fri Nov 29 00:53:13 2002
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-keywest.c Tue Dec 23 19:02:05 2003
@@ -47,3 +47,2 @@
#include <linux/config.h>
-#include <linux/version.h>
#include <linux/kernel.h>
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-philips-par.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-philips-par.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-philips-par.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-philips-par.c Tue Dec 23 19:02:05 2003
@@ -248,3 +248,2 @@
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
static struct parport_driver i2c_driver = {
@@ -255,3 +254,2 @@
};
-#endif
@@ -259,13 +257,5 @@
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,4)
- struct parport *port;
-#endif
printk(KERN_INFO "i2c-philips-par.o: i2c Philips parallel port adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
parport_register_driver(&i2c_driver);
-#else
- for (port = parport_enumerate(); port; port=port->next)
- i2c_parport_attach(port);
-#endif
@@ -276,9 +266,3 @@
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
parport_unregister_driver(&i2c_driver);
-#else
- struct parport *port;
- for (port = parport_enumerate(); port; port=port->next)
- i2c_parport_detach(port);
-#endif
}
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-proc.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-proc.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-proc.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-proc.c Tue Dec 23 19:02:05 2003
@@ -25,3 +25,2 @@
-#include <linux/version.h>
#include <linux/module.h>
@@ -63,6 +62,2 @@
static unsigned short i2c_inodes[SENSORS_ENTRY_MAX];
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)
-static void i2c_fill_inode(struct inode *inode, int fill);
-static void i2c_dir_fill_inode(struct inode *inode, int fill);
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) */
@@ -196,8 +191,3 @@
new_header->ctl_table->child->child->de->low_ino;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27))
new_header->ctl_table->child->child->de->owner = controlling_mod;
-#else
- new_header->ctl_table->child->child->de->fill_inode - &i2c_dir_fill_inode;
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27)) */
@@ -863,8 +853,3 @@
register_sysctl_table(i2c_proc, 0))) return -ENOMEM;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1))
i2c_proc_header->ctl_table->child->de->owner = THIS_MODULE;
-#else
- i2c_proc_header->ctl_table->child->de->fill_inode - &i2c_fill_inode;
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1)) */
i2c_initialized++;
diff -r -U1 linux-2.4.24-pre2-k1/include/linux/i2c.h linux-2.4.24-pre2-k2/include/linux/i2c.h
--- linux-2.4.24-pre2-k1/include/linux/i2c.h Mon Dec 22 22:20:29 2003
+++ linux-2.4.24-pre2-k2/include/linux/i2c.h Tue Dec 23 20:05:40 2003
@@ -44,13 +44,3 @@
-#include <linux/version.h>
-#ifndef KERNEL_VERSION
-#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
-#endif
-
-#include <asm/page.h> /* for 2.2.xx */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,0,25)
-#include <linux/sched.h>
-#else
#include <asm/semaphore.h>
-#endif
#include <linux/config.h>
@@ -228,6 +218,2 @@
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)
-struct proc_dir_entry;
-#endif
-
/*
@@ -269,5 +255,2 @@
int inode;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)
- struct proc_dir_entry *proc_entry;
-#endif
#endif /* def CONFIG_PROC_FS */
--
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
WARNING: multiple messages have this Message-ID (diff)
From: Jean Delvare <khali@linux-fr.org>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
LM Sensors <sensors@stimpy.netroedge.com>
Subject: [PATCH 2.4] i2c cleanups, second wave (2/5)
Date: Wed, 24 Dec 2003 23:32:10 +0100 [thread overview]
Message-ID: <20031224233210.4573f541.khali@linux-fr.org> (raw)
In-Reply-To: <20031224225707.749707e5.khali@linux-fr.org>
This patch drops almost all compatibility stuff that was leftover from
times of kernel 2.2. A few extra includes may have survived, we will
take care of them later.
Most of the work was done by Kyösti Mälkki. Original comment follows:
***
Remove code for KERNEL_VERSION tests.
***
Note that this patch was voluntarily generated using diff -U1, because
it contains only removals, so much context isn't required. Doing so
makes this patch apply successfully even if you don't apply the patch #1
of this second wave first.
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-adap-ite.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-adap-ite.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-adap-ite.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-adap-ite.c Tue Dec 23 19:02:05 2003
@@ -40,3 +40,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
@@ -63,7 +62,3 @@
static struct iic_ite gpi;
-#if (LINUX_VERSION_CODE < 0x020301)
-static struct wait_queue *iic_wait = NULL;
-#else
static wait_queue_head_t iic_wait;
-#endif
static int iic_pending;
@@ -273,5 +268,2 @@
iic_ite_data.data = (void *)piic;
-#if (LINUX_VERSION_CODE >= 0x020301)
- init_waitqueue_head(&iic_wait);
-#endif
if (iic_hw_resrc_init() == 0) {
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-algo-bit.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-bit.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-algo-bit.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-bit.c Tue Dec 23 19:02:05 2003
@@ -29,3 +29,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-algo-ite.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-ite.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-algo-ite.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-ite.c Tue Dec 23 19:02:05 2003
@@ -40,3 +40,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-algo-pcf.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-pcf.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-algo-pcf.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-pcf.c Tue Dec 23 19:02:05 2003
@@ -33,3 +33,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-core.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-core.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-core.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-core.c Tue Dec 23 19:02:05 2003
@@ -35,9 +35,4 @@
-#include <linux/version.h>
#include <linux/init.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)
-#define init_MUTEX(s) do { *(s) = MUTEX; } while(0)
-#endif
-
#include <asm/uaccess.h>
@@ -86,6 +81,2 @@
-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,27))
-static void monitor_bus_i2c(struct inode *inode, int fill);
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */
-
static ssize_t i2cproc_bus_read(struct file * file, char * buf,size_t count,
@@ -101,8 +92,2 @@
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,48))
-static struct inode_operations i2cproc_inode_operations = {
- &i2cproc_operations
-};
-#endif
-
static int i2cproc_initialized = 0;
@@ -166,12 +151,4 @@
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,48))
proc_entry->proc_fops = &i2cproc_operations;
-#else
- proc_entry->ops = &i2cproc_inode_operations;
-#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27))
proc_entry->owner = THIS_MODULE;
-#else
- proc_entry->fill_inode = &monitor_bus_i2c;
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */
adap->inode = proc_entry->low_ino;
@@ -613,14 +590,2 @@
-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,27))
-/* Monitor access to /proc/bus/i2c*; make unloading i2c-proc impossible
- if some process still uses it or some file in it */
-void monitor_bus_i2c(struct inode *inode, int fill)
-{
- if (fill)
- MOD_INC_USE_COUNT;
- else
- MOD_DEC_USE_COUNT;
-}
-#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,37)) */
-
/* This function generates the output for /proc/bus/i2c */
@@ -734,7 +699,3 @@
proc_bus_i2c->read_proc = &read_bus_i2c;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27))
proc_bus_i2c->owner = THIS_MODULE;
-#else
- proc_bus_i2c->fill_inode = &monitor_bus_i2c;
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27)) */
i2cproc_initialized += 2;
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-dev.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-dev.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-dev.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-dev.c Tue Dec 23 19:02:05 2003
@@ -37,6 +37,3 @@
#include <linux/slab.h>
-#include <linux/version.h>
-#if LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0)
#include <linux/smp_lock.h>
-#endif /* LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0) */
#ifdef CONFIG_DEVFS_FS
@@ -57,5 +54,2 @@
-#if LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,9)
-static loff_t i2cdev_lseek (struct file *file, loff_t offset, int origin);
-#endif
static ssize_t i2cdev_read (struct file *file, char *buf, size_t count,
@@ -79,10 +73,4 @@
static struct file_operations i2cdev_fops = {
-#if LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0)
owner: THIS_MODULE,
-#endif /* LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0) */
-#if LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,9)
- llseek: i2cdev_lseek,
-#else
llseek: no_llseek,
-#endif
read: i2cdev_read,
@@ -124,16 +112,2 @@
-#if LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,9)
-/* Note that the lseek function is called llseek in 2.1 kernels. But things
- are complicated enough as is. */
-loff_t i2cdev_lseek (struct file *file, loff_t offset, int origin)
-{
-#ifdef DEBUG
- struct inode *inode = file->f_dentry->d_inode;
- printk("i2c-dev.o: i2c-%d lseek to %ld bytes relative to %d.\n",
- MINOR(inode->i_rdev),(long) offset,origin);
-#endif /* DEBUG */
- return -ESPIPE;
-}
-#endif
-
static ssize_t i2cdev_read (struct file *file, char *buf, size_t count,
@@ -425,5 +399,2 @@
i2cdev_adaps[minor]->inc_use(i2cdev_adaps[minor]);
-#if LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,0)
- MOD_INC_USE_COUNT;
-#endif /* LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,0) */
@@ -443,12 +414,6 @@
#endif
-#if LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,0)
- MOD_DEC_USE_COUNT;
-#else /* LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0) */
lock_kernel();
-#endif /* LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,0) */
if (i2cdev_adaps[minor]->dec_use)
i2cdev_adaps[minor]->dec_use(i2cdev_adaps[minor]);
-#if LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0)
unlock_kernel();
-#endif /* LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0) */
return 0;
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-elektor.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-elektor.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-elektor.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-elektor.c Tue Dec 23 19:02:05 2003
@@ -32,3 +32,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
@@ -57,7 +56,3 @@
-#if (LINUX_VERSION_CODE < 0x020301)
-static struct wait_queue *pcf_wait = NULL;
-#else
static wait_queue_head_t pcf_wait;
-#endif
static int pcf_pending;
@@ -270,5 +265,3 @@
-#if (LINUX_VERSION_CODE >= 0x020301)
init_waitqueue_head(&pcf_wait);
-#endif
if (pcf_isa_init() == 0) {
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-elv.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-elv.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-elv.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-elv.c Tue Dec 23 19:02:05 2003
@@ -29,3 +29,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-keywest.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-keywest.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-keywest.c Fri Nov 29 00:53:13 2002
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-keywest.c Tue Dec 23 19:02:05 2003
@@ -47,3 +47,2 @@
#include <linux/config.h>
-#include <linux/version.h>
#include <linux/kernel.h>
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-philips-par.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-philips-par.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-philips-par.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-philips-par.c Tue Dec 23 19:02:05 2003
@@ -248,3 +248,2 @@
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
static struct parport_driver i2c_driver = {
@@ -255,3 +254,2 @@
};
-#endif
@@ -259,13 +257,5 @@
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,4)
- struct parport *port;
-#endif
printk(KERN_INFO "i2c-philips-par.o: i2c Philips parallel port adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
parport_register_driver(&i2c_driver);
-#else
- for (port = parport_enumerate(); port; port=port->next)
- i2c_parport_attach(port);
-#endif
@@ -276,9 +266,3 @@
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
parport_unregister_driver(&i2c_driver);
-#else
- struct parport *port;
- for (port = parport_enumerate(); port; port=port->next)
- i2c_parport_detach(port);
-#endif
}
diff -r -U1 linux-2.4.24-pre2-k1/drivers/i2c/i2c-proc.c linux-2.4.24-pre2-k2/drivers/i2c/i2c-proc.c
--- linux-2.4.24-pre2-k1/drivers/i2c/i2c-proc.c Mon Dec 22 22:04:00 2003
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-proc.c Tue Dec 23 19:02:05 2003
@@ -25,3 +25,2 @@
-#include <linux/version.h>
#include <linux/module.h>
@@ -63,6 +62,2 @@
static unsigned short i2c_inodes[SENSORS_ENTRY_MAX];
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)
-static void i2c_fill_inode(struct inode *inode, int fill);
-static void i2c_dir_fill_inode(struct inode *inode, int fill);
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) */
@@ -196,8 +191,3 @@
new_header->ctl_table->child->child->de->low_ino;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27))
new_header->ctl_table->child->child->de->owner = controlling_mod;
-#else
- new_header->ctl_table->child->child->de->fill_inode =
- &i2c_dir_fill_inode;
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27)) */
@@ -863,8 +853,3 @@
register_sysctl_table(i2c_proc, 0))) return -ENOMEM;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1))
i2c_proc_header->ctl_table->child->de->owner = THIS_MODULE;
-#else
- i2c_proc_header->ctl_table->child->de->fill_inode =
- &i2c_fill_inode;
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1)) */
i2c_initialized++;
diff -r -U1 linux-2.4.24-pre2-k1/include/linux/i2c.h linux-2.4.24-pre2-k2/include/linux/i2c.h
--- linux-2.4.24-pre2-k1/include/linux/i2c.h Mon Dec 22 22:20:29 2003
+++ linux-2.4.24-pre2-k2/include/linux/i2c.h Tue Dec 23 20:05:40 2003
@@ -44,13 +44,3 @@
-#include <linux/version.h>
-#ifndef KERNEL_VERSION
-#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
-#endif
-
-#include <asm/page.h> /* for 2.2.xx */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,0,25)
-#include <linux/sched.h>
-#else
#include <asm/semaphore.h>
-#endif
#include <linux/config.h>
@@ -228,6 +218,2 @@
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)
-struct proc_dir_entry;
-#endif
-
/*
@@ -269,5 +255,2 @@
int inode;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)
- struct proc_dir_entry *proc_entry;
-#endif
#endif /* def CONFIG_PROC_FS */
--
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
next prev parent reply other threads:[~2005-05-19 6:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-24 21:57 [PATCH 2.4] i2c cleanups, second wave Jean Delvare
2005-05-19 6:24 ` Jean Delvare
2003-12-24 22:12 ` [PATCH 2.4] i2c cleanups, second wave (1/5) Jean Delvare
2005-05-19 6:24 ` Jean Delvare
2003-12-24 22:32 ` Jean Delvare [this message]
2005-05-19 6:24 ` [PATCH 2.4] i2c cleanups, second wave (2/5) Jean Delvare
2003-12-24 22:42 ` [PATCH 2.4] i2c cleanups, second wave (3/5) Jean Delvare
2005-05-19 6:24 ` Jean Delvare
2003-12-24 23:03 ` [PATCH 2.4] i2c cleanups, second wave (4/5) Jean Delvare
2005-05-19 6:24 ` Jean Delvare
2003-12-24 23:11 ` [PATCH 2.4] i2c cleanups, second wave (5/5) Jean Delvare
2005-05-19 6:24 ` Jean Delvare
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031224233210.4573f541.khali@linux-fr.org \
--to=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.tosatti@cyclades.com \
--cc=sensors@stimpy.netroedge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.