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();