From dabc5bfbb686f36117947c74256b6122bc1d3613 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Thu, 7 Jan 1999 20:07:15 +0000 Subject: [PATCH] i2c-proc bug resolved git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@147 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 4 ++++ kernel/i2c-proc.c | 11 +++++++++-- src/i2c-proc.c | 11 +++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index be9cb224..7b143631 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,10 @@ ask CVS about it: for example: cvs diff -r V2-0-0 -r V2-0-1 -u +2.1.1 (19990107) + Module i2c-proc.o: Hack to make /proc/bus/ possible for kernels 2.0.35 + and older + Module gl518sm.o: Miscelaneous bugs and problems solved 2.1.0 (19981230) Library: Completely NEW diff --git a/kernel/i2c-proc.c b/kernel/i2c-proc.c index 4b2c49d2..383386d5 100644 --- a/kernel/i2c-proc.c +++ b/kernel/i2c-proc.c @@ -70,7 +70,9 @@ static struct proc_dir_entry proc_bus_dir = /* uid */ 0, /* gid */ 0, /* size */ 0, - /* ops */ &proc_dir_inode_operations, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) + /* ops */ &proc_dir_inode_operations, +#endif }; static struct proc_dir_entry proc_bus_i2c_dir = @@ -170,7 +172,12 @@ int i2cproc_init(void) i2cproc_initialized += 2; #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */ /* In Linux 2.0.x, there is no /proc/bus! But I hope no other module - introduced it, or we are fucked. */ + introduced it, or we are fucked. And 2.0.35 and earlier does not + export proc_dir_inode_operations, so we grab it from proc_net, + which also uses it. Not nice. */ +/* #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,0,36) */ + proc_bus_dir.ops = proc_net.ops; +/* #endif */ if ((res = proc_register_dynamic(&proc_root, &proc_bus_dir))) { printk("i2c-proc.o: Could not create /proc/bus/, module not inserted.\n"); i2cproc_cleanup(); diff --git a/src/i2c-proc.c b/src/i2c-proc.c index 4b2c49d2..383386d5 100644 --- a/src/i2c-proc.c +++ b/src/i2c-proc.c @@ -70,7 +70,9 @@ static struct proc_dir_entry proc_bus_dir = /* uid */ 0, /* gid */ 0, /* size */ 0, - /* ops */ &proc_dir_inode_operations, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) + /* ops */ &proc_dir_inode_operations, +#endif }; static struct proc_dir_entry proc_bus_i2c_dir = @@ -170,7 +172,12 @@ int i2cproc_init(void) i2cproc_initialized += 2; #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */ /* In Linux 2.0.x, there is no /proc/bus! But I hope no other module - introduced it, or we are fucked. */ + introduced it, or we are fucked. And 2.0.35 and earlier does not + export proc_dir_inode_operations, so we grab it from proc_net, + which also uses it. Not nice. */ +/* #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,0,36) */ + proc_bus_dir.ops = proc_net.ops; +/* #endif */ if ((res = proc_register_dynamic(&proc_root, &proc_bus_dir))) { printk("i2c-proc.o: Could not create /proc/bus/, module not inserted.\n"); i2cproc_cleanup();