testers wanted
Do any of you have the possibility to compile 2.4 kernels on non-i386 architectures? I plan to submit the attached patch for inclusion into 2.4.24. Since it affects the way all modules are initialized and cleaned up, testers for modules that cannot be used on i386 systems would be welcome. Please test both as module and in-kernel if possible. There is no need to actually test the drivers, only to compile them.
The patch is for 2.4.24-pre2, and will not apply cleanly to 2.4.23.
Thanks.
Signature · 813 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
-------------- next part --------------
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-adap-ite.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-adap-ite.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-adap-ite.c Sat Aug 3 02:39:44 2002
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-adap-ite.c Mon Dec 22 19:36:23 2003
@@ -286,7 +286,7 @@
}
-static void iic_ite_exit(void)
+static void __exit iic_ite_exit(void)
{
i2c_iic_del_bus(&iic_ite_ops);
iic_ite_release();
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-algo-bit.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-algo-bit.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-algo-bit.c Wed Dec 17 19:22:00 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-algo-bit.c Mon Dec 22 19:36:23 2003
@@ -607,18 +607,9 @@
return 0;
}
-int __init i2c_algo_bit_init (void)
-{
- printk(KERN_INFO "i2c-algo-bit.o: i2c bit algorithm module\n");
- return 0;
-}
-
-
-
EXPORT_SYMBOL(i2c_bit_add_bus);
EXPORT_SYMBOL(i2c_bit_del_bus);
-#ifdef MODULE
MODULE_AUTHOR("Simon G. Vogl <[email protected]>");
MODULE_DESCRIPTION("I2C-Bus bit-banging algorithm");
MODULE_LICENSE("GPL");
@@ -631,13 +622,3 @@
MODULE_PARM_DESC(bit_scan, "Scan for active chips on the bus");
MODULE_PARM_DESC(i2c_debug,
"debug level - 0 off; 1 normal; 2,3 more verbose; 9 bit-protocol");
-
-int init_module(void)
-{
- return i2c_algo_bit_init();
-}
-
-void cleanup_module(void)
-{
-}
-#endif
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-algo-ite.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-algo-ite.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-algo-ite.c Thu Oct 11 17:05:47 2001
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-algo-ite.c Mon Dec 22 19:36:23 2003
@@ -822,20 +822,6 @@
return 0;
}
-
-int __init i2c_algo_iic_init (void)
-{
- printk(KERN_INFO "ITE iic (i2c) algorithm module\n");
- return 0;
-}
-
-
-void i2c_algo_iic_exit(void)
-{
- return;
-}
-
-
EXPORT_SYMBOL(i2c_iic_add_bus);
EXPORT_SYMBOL(i2c_iic_del_bus);
@@ -854,20 +840,3 @@
MODULE_PARM_DESC(iic_scan, "Scan for active chips on the bus");
MODULE_PARM_DESC(i2c_debug,
"debug level - 0 off; 1 normal; 2,3 more verbose; 9 iic-protocol");
-
-
-/* This function resolves to init_module (the function invoked when a module
- * is loaded via insmod) when this file is compiled with MODULES defined.
- * Otherwise (i.e. if you want this driver statically linked to the kernel),
- * a pointer to this function is stored in a table and called
- * during the intialization of the kernel (in do_basic_setup in /init/main.c)
- *
- * All this functionality is complements of the macros defined in linux/init.h
- */
-module_init(i2c_algo_iic_init);
-
-
-/* If MODULES is defined when this file is compiled, then this function will
- * resolved to cleanup_module.
- */
-module_exit(i2c_algo_iic_exit);
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-algo-pcf.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-algo-pcf.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-algo-pcf.c Wed Dec 17 19:22:00 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-algo-pcf.c Mon Dec 22 19:36:23 2003
@@ -522,17 +522,9 @@
return 0;
}
-int __init i2c_algo_pcf_init (void)
-{
- printk("i2c-algo-pcf.o: i2c pcf8584 algorithm module\n");
- return 0;
-}
-
-
EXPORT_SYMBOL(i2c_pcf_add_bus);
EXPORT_SYMBOL(i2c_pcf_del_bus);
-#ifdef MODULE
MODULE_AUTHOR("Hans Berglund <[email protected]>");
MODULE_DESCRIPTION("I2C-Bus PCF8584 algorithm");
MODULE_LICENSE("GPL");
@@ -543,14 +535,3 @@
MODULE_PARM_DESC(pcf_scan, "Scan for active chips on the bus");
MODULE_PARM_DESC(i2c_debug,
"debug level - 0 off; 1 normal; 2,3 more verbose; 9 pcf-protocol");
-
-
-int init_module(void)
-{
- return i2c_algo_pcf_init();
-}
-
-void cleanup_module(void)
-{
-}
-#endif
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-algo-sibyte.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-algo-sibyte.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-algo-sibyte.c Mon Aug 25 13:44:41 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-algo-sibyte.c Mon Dec 22 19:36:23 2003
@@ -203,29 +203,11 @@
return 0;
}
-int __init i2c_algo_sibyte_init (void)
-{
- printk("i2c-algo-sibyte.o: i2c SiByte algorithm module\n");
- return 0;
-}
-
-
EXPORT_SYMBOL(i2c_sibyte_add_bus);
EXPORT_SYMBOL(i2c_sibyte_del_bus);
-#ifdef MODULE
MODULE_AUTHOR("Kip Walker, Broadcom Corp.");
MODULE_DESCRIPTION("SiByte I2C-Bus algorithm");
MODULE_PARM(bit_scan, "i");
MODULE_PARM_DESC(bit_scan, "Scan for active chips on the bus");
MODULE_LICENSE("GPL");
-
-int init_module(void)
-{
- return i2c_algo_sibyte_init();
-}
-
-void cleanup_module(void)
-{
-}
-#endif
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-core.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-core.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-core.c Wed Dec 17 19:22:00 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-core.c Mon Dec 22 19:36:23 2003
@@ -1273,121 +1273,27 @@
init_MUTEX(&adap_lock);
init_MUTEX(&driver_lock);
- i2cproc_init();
-
+#ifdef CONFIG_PROC_FS
+ return i2cproc_init();
+#else
return 0;
-}
-
-#ifndef MODULE
-#ifdef CONFIG_I2C_CHARDEV
- extern int i2c_dev_init(void);
-#endif
-#ifdef CONFIG_I2C_ALGOBIT
- extern int i2c_algo_bit_init(void);
-#endif
-#ifdef CONFIG_I2C_PHILIPSPAR
- extern int i2c_bitlp_init(void);
-#endif
-#ifdef CONFIG_I2C_ELV
- extern int i2c_bitelv_init(void);
-#endif
-#ifdef CONFIG_I2C_VELLEMAN
- extern int i2c_bitvelle_init(void);
-#endif
-#ifdef CONFIG_I2C_BITVIA
- extern int i2c_bitvia_init(void);
-#endif
-
-#ifdef CONFIG_I2C_ALGOPCF
- extern int i2c_algo_pcf_init(void);
-#endif
-#ifdef CONFIG_I2C_ELEKTOR
- extern int i2c_pcfisa_init(void);
-#endif
-
-#ifdef CONFIG_I2C_ALGO8XX
- extern int i2c_algo_8xx_init(void);
-#endif
-#ifdef CONFIG_I2C_RPXLITE
- extern int i2c_rpx_init(void);
-#endif
-
-#ifdef CONFIG_I2C_ALGO_SIBYTE
- extern int i2c_algo_sibyte_init(void);
- extern int i2c_sibyte_init(void);
-#endif
-#ifdef CONFIG_I2C_MAX1617
- extern int i2c_max1617_init(void);
#endif
+}
-#ifdef CONFIG_I2C_PROC
- extern int sensors_init(void);
+static void __exit i2c_exit(void)
+{
+#ifdef CONFIG_PROC_FS
+ i2cproc_cleanup();
#endif
+}
-/* This is needed for automatic patch generation: sensors code starts here */
-/* This is needed for automatic patch generation: sensors code ends here */
-
+/* leave this in for now simply to make patching easier so we don't have
+ to remove the call in drivers/char/mem.c */
int __init i2c_init_all(void)
{
- /* --------------------- global ----- */
- i2c_init();
-
-#ifdef CONFIG_I2C_CHARDEV
- i2c_dev_init();
-#endif
- /* --------------------- bit -------- */
-#ifdef CONFIG_I2C_ALGOBIT
- i2c_algo_bit_init();
-#endif
-#ifdef CONFIG_I2C_PHILIPSPAR
- i2c_bitlp_init();
-#endif
-#ifdef CONFIG_I2C_ELV
- i2c_bitelv_init();
-#endif
-#ifdef CONFIG_I2C_VELLEMAN
- i2c_bitvelle_init();
-#endif
-
- /* --------------------- pcf -------- */
-#ifdef CONFIG_I2C_ALGOPCF
- i2c_algo_pcf_init();
-#endif
-#ifdef CONFIG_I2C_ELEKTOR
- i2c_pcfisa_init();
-#endif
-
- /* --------------------- 8xx -------- */
-#ifdef CONFIG_I2C_ALGO8XX
- i2c_algo_8xx_init();
-#endif
-#ifdef CONFIG_I2C_RPXLITE
- i2c_rpx_init();
-#endif
-
- /* --------------------- SiByte -------- */
-#ifdef CONFIG_I2C_ALGO_SIBYTE
- i2c_algo_sibyte_init();
- i2c_sibyte_init();
-#endif
-#ifdef CONFIG_I2C_MAX1617
- i2c_max1617_init();
-#endif
-
- /* -------------- proc interface ---- */
-#ifdef CONFIG_I2C_PROC
- sensors_init();
-#endif
-/* This is needed for automatic patch generation: sensors code starts here */
-/* This is needed for automatic patch generation: sensors code ends here */
-
return 0;
}
-#endif
-
-
-
EXPORT_SYMBOL(i2c_add_adapter);
EXPORT_SYMBOL(i2c_del_adapter);
EXPORT_SYMBOL(i2c_add_driver);
@@ -1424,7 +1330,6 @@
EXPORT_SYMBOL(i2c_get_functionality);
EXPORT_SYMBOL(i2c_check_functionality);
-#ifdef MODULE
MODULE_AUTHOR("Simon G. Vogl <[email protected]>");
MODULE_DESCRIPTION("I2C-Bus main module");
MODULE_LICENSE("GPL");
@@ -1432,13 +1337,5 @@
MODULE_PARM(i2c_debug, "i");
MODULE_PARM_DESC(i2c_debug,"debug level");
-int init_module(void)
-{
- return i2c_init();
-}
-
-void cleanup_module(void)
-{
- i2cproc_cleanup();
-}
-#endif
+module_init(i2c_init);
+module_exit(i2c_exit);
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-dev.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-dev.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-dev.c Wed Dec 17 19:22:00 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-dev.c Mon Dec 22 21:07:13 2003
@@ -53,11 +53,6 @@
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
-#ifdef MODULE
-extern int init_module(void);
-extern int cleanup_module(void);
-#endif /* def MODULE */
-
/* struct file_operations changed too often in the 2.1 series for nice code */
#if LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,9)
@@ -79,12 +74,6 @@
static int i2cdev_command(struct i2c_client *client, unsigned int cmd,
void *arg);
-#ifdef MODULE
-static
-#else
-extern
-#endif
- int __init i2c_dev_init(void);
static int i2cdev_cleanup(void);
static struct file_operations i2cdev_fops = {
@@ -514,7 +503,7 @@
return -1;
}
-int __init i2c_dev_init(void)
+static int __init i2c_dev_init(void)
{
int res;
@@ -544,7 +533,7 @@
return 0;
}
-int i2cdev_cleanup(void)
+static int __exit i2cdev_cleanup(void)
{
int res;
@@ -573,23 +562,16 @@
return 0;
}
-EXPORT_NO_SYMBOLS;
+static void __exit i2c_dev_exit(void)
+{
+ i2cdev_cleanup();
+}
-#ifdef MODULE
+EXPORT_NO_SYMBOLS;
MODULE_AUTHOR("Frodo Looijaard <[email protected]> and Simon G. Vogl <[email protected]>");
MODULE_DESCRIPTION("I2C /dev entries driver");
MODULE_LICENSE("GPL");
-int init_module(void)
-{
- return i2c_dev_init();
-}
-
-int cleanup_module(void)
-{
- return i2cdev_cleanup();
-}
-
-#endif /* def MODULE */
-
+module_init(i2c_dev_init);
+module_exit(i2c_dev_exit);
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-elektor.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-elektor.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-elektor.c Wed Dec 17 19:22:00 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-elektor.c Mon Dec 22 19:36:23 2003
@@ -160,19 +160,6 @@
return 0;
}
-
-static void __exit pcf_isa_exit(void)
-{
- if (irq > 0) {
- disable_irq(irq);
- free_irq(irq, 0);
- }
- if (!mmapped) {
- release_region(base , 2);
- }
-}
-
-
static int pcf_isa_reg(struct i2c_client *client)
{
return 0;
@@ -224,7 +211,7 @@
pcf_isa_unreg,
};
-int __init i2c_pcfisa_init(void)
+static int __init i2c_pcfisa_init(void)
{
#ifdef __alpha__
/* check to see we have memory mapped PCF8584 connected to the
@@ -296,10 +283,21 @@
return 0;
}
+static void __exit i2c_pcfisa_exit(void)
+{
+ i2c_pcf_del_bus(&pcf_isa_ops);
+
+ if (irq > 0) {
+ disable_irq(irq);
+ free_irq(irq, 0);
+ }
+
+ if (!mmapped)
+ release_region(base , 2);
+}
EXPORT_NO_SYMBOLS;
-#ifdef MODULE
MODULE_AUTHOR("Hans Berglund <[email protected]>");
MODULE_DESCRIPTION("I2C-Bus adapter routines for PCF8584 ISA bus adapter");
MODULE_LICENSE("GPL");
@@ -311,15 +309,5 @@
MODULE_PARM(mmapped, "i");
MODULE_PARM(i2c_debug, "i");
-int init_module(void)
-{
- return i2c_pcfisa_init();
-}
-
-void cleanup_module(void)
-{
- i2c_pcf_del_bus(&pcf_isa_ops);
- pcf_isa_exit();
-}
-
-#endif
+module_init(i2c_pcfisa_init);
+module_exit(i2c_pcfisa_exit);
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-elv.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-elv.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-elv.c Wed Dec 17 19:22:00 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-elv.c Mon Dec 22 19:36:23 2003
@@ -115,11 +115,6 @@
return 0;
}
-static void __exit bit_elv_exit(void)
-{
- release_region( base , (base = 0x3bc)? 3 : 8 );
-}
-
static int bit_elv_reg(struct i2c_client *client)
{
return 0;
@@ -168,7 +163,7 @@
bit_elv_unreg,
};
-int __init i2c_bitelv_init(void)
+static int __init i2c_bitelv_init(void)
{
printk(KERN_INFO "i2c-elv.o: i2c ELV parallel port adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE);
if (base=0) {
@@ -194,25 +189,19 @@
return 0;
}
+static void __exit i2c_bitelv_exit(void)
+{
+ i2c_bit_del_bus(&bit_elv_ops);
+ release_region(base, (base = 0x3bc) ? 3 : 8);
+}
EXPORT_NO_SYMBOLS;
-#ifdef MODULE
MODULE_AUTHOR("Simon G. Vogl <[email protected]>");
MODULE_DESCRIPTION("I2C-Bus adapter routines for ELV parallel port adapter");
MODULE_LICENSE("GPL");
MODULE_PARM(base, "i");
-int init_module(void)
-{
- return i2c_bitelv_init();
-}
-
-void cleanup_module(void)
-{
- i2c_bit_del_bus(&bit_elv_ops);
- bit_elv_exit();
-}
-
-#endif
+module_init(i2c_bitelv_init);
+module_exit(i2c_bitelv_exit);
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-max1617.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-max1617.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-max1617.c Mon Aug 25 13:44:41 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-max1617.c Mon Dec 22 19:36:23 2003
@@ -200,26 +200,21 @@
#endif
}
-void i2c_max1617_init(void)
+static int __init i2c_max1617_init(void)
{
- i2c_add_driver(&i2c_driver_max1617);
+ return i2c_add_driver(&i2c_driver_max1617);
+}
+
+static void __exit i2c_max1617_exit(void)
+{
+ i2c_del_driver(&i2c_driver_max1617);
}
EXPORT_NO_SYMBOLS;
-#ifdef MODULE
MODULE_AUTHOR("Kip Walker, Broadcom Corp.");
MODULE_DESCRIPTION("Max 1617 temperature sensor for SiByte SOC boards");
MODULE_LICENSE("GPL");
-int init_module(void)
-{
- i2c_max1617_init();
- return 0;
-}
-
-void cleanup_module(void)
-{
- i2c_del_driver(&i2c_driver_max1617);
-}
-#endif
+module_init(i2c_max1617_init);
+module_exit(i2c_max1617_exit);
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-philips-par.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-philips-par.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-philips-par.c Wed Dec 17 19:22:00 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-philips-par.c Mon Dec 22 19:40:43 2003
@@ -29,14 +29,10 @@
#include <linux/init.h>
#include <linux/stddef.h>
#include <linux/parport.h>
-
+#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
-#ifndef __exit
-#define __exit __init
-#endif
-
static int type;
struct i2c_par
@@ -259,7 +255,7 @@
};
#endif
-int __init i2c_bitlp_init(void)
+static int __init i2c_bitlp_init(void)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,4)
struct parport *port;
@@ -276,7 +272,7 @@
return 0;
}
-void __exit i2c_bitlp_exit(void)
+static void __exit i2c_bitlp_exit(void)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
parport_unregister_driver(&i2c_driver);
@@ -295,14 +291,5 @@
MODULE_PARM(type, "i");
-#ifdef MODULE
-int init_module(void)
-{
- return i2c_bitlp_init();
-}
-
-void cleanup_module(void)
-{
- i2c_bitlp_exit();
-}
-#endif
+module_init(i2c_bitlp_init);
+module_exit(i2c_bitlp_exit);
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-proc.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-proc.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-proc.c Wed Dec 17 19:22:00 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-proc.c Mon Dec 22 19:36:23 2003
@@ -56,8 +56,6 @@
void *newval, size_t newlen,
void **context);
-int __init sensors_init(void);
-
#define SENSORS_ENTRY_MAX 20
static struct ctl_table_header *i2c_entries[SENSORS_ENTRY_MAX];
@@ -856,7 +854,7 @@
return 0;
}
-int __init sensors_init(void)
+static int __init i2c_proc_init(void)
{
printk(KERN_INFO "i2c-proc.o version %s (%s)\n", I2C_VERSION, I2C_DATE);
i2c_initialized = 0;
@@ -873,34 +871,23 @@
return 0;
}
+static void __exit i2c_proc_exit(void)
+{
+ if (i2c_initialized >= 1) {
+ unregister_sysctl_table(i2c_proc_header);
+ i2c_initialized--;
+ }
+}
+
EXPORT_SYMBOL(i2c_deregister_entry);
EXPORT_SYMBOL(i2c_detect);
EXPORT_SYMBOL(i2c_proc_real);
EXPORT_SYMBOL(i2c_register_entry);
EXPORT_SYMBOL(i2c_sysctl_real);
-#ifdef MODULE
-
MODULE_AUTHOR("Frodo Looijaard <[email protected]>");
MODULE_DESCRIPTION("i2c-proc driver");
MODULE_LICENSE("GPL");
-int i2c_cleanup(void)
-{
- if (i2c_initialized >= 1) {
- unregister_sysctl_table(i2c_proc_header);
- i2c_initialized--;
- }
- return 0;
-}
-
-int init_module(void)
-{
- return sensors_init();
-}
-
-int cleanup_module(void)
-{
- return i2c_cleanup();
-}
-#endif /* MODULE */
+module_init(i2c_proc_init);
+module_exit(i2c_proc_exit);
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-sibyte.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-sibyte.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-sibyte.c Mon Aug 25 13:44:41 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-sibyte.c Mon Dec 22 19:36:23 2003
@@ -82,7 +82,7 @@
}
};
-int __init i2c_sibyte_init(void)
+static int __init i2c_sibyte_init(void)
{
printk("i2c-swarm.o: i2c SMBus adapter module for SiByte board\n");
if (i2c_sibyte_add_bus(&sibyte_board_adapter[0], K_SMB_FREQ_100KHZ) < 0)
@@ -92,23 +92,17 @@
return 0;
}
+static void __exit i2c_sibyte_exit(void)
+{
+ i2c_sibyte_del_bus(&sibyte_board_adapter[0]);
+ i2c_sibyte_del_bus(&sibyte_board_adapter[1]);
+}
EXPORT_NO_SYMBOLS;
-#ifdef MODULE
MODULE_AUTHOR("Kip Walker, Broadcom Corp.");
MODULE_DESCRIPTION("SMBus adapter routines for SiByte boards");
MODULE_LICENSE("GPL");
-int init_module(void)
-{
- return i2c_sibyte_init();
-}
-
-void cleanup_module(void)
-{
- i2c_sibyte_del_bus(&sibyte_board_adapter[0]);
- i2c_sibyte_del_bus(&sibyte_board_adapter[1]);
-}
-
-#endif
+module_init(i2c_sibyte_init);
+module_exit(i2c_sibyte_exit);
diff -ruN linux-2.4.23-bk13/drivers/i2c/i2c-velleman.c linux-2.4.23-bk13-k1/drivers/i2c/i2c-velleman.c
--- linux-2.4.23-bk13/drivers/i2c/i2c-velleman.c Wed Dec 17 19:22:00 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/i2c-velleman.c Mon Dec 22 19:36:23 2003
@@ -103,12 +103,6 @@
return 0;
}
-static void __exit bit_velle_exit(void)
-{
- release_region( base , (base = 0x3bc)? 3 : 8 );
-}
-
-
static int bit_velle_reg(struct i2c_client *client)
{
return 0;
@@ -158,7 +152,7 @@
bit_velle_unreg,
};
-int __init i2c_bitvelle_init(void)
+static int __init i2c_bitvelle_init(void)
{
printk(KERN_INFO "i2c-velleman.o: i2c Velleman K8000 adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE);
if (base=0) {
@@ -184,24 +178,19 @@
return 0;
}
+static void __exit i2c_bitvelle_exit(void)
+{
+ i2c_bit_del_bus(&bit_velle_ops);
+ release_region(base, (base = 0x3bc) ? 3 : 8);
+}
+
EXPORT_NO_SYMBOLS;
-#ifdef MODULE
MODULE_AUTHOR("Simon G. Vogl <[email protected]>");
MODULE_DESCRIPTION("I2C-Bus adapter routines for Velleman K8000 adapter");
MODULE_LICENSE("GPL");
MODULE_PARM(base, "i");
-int init_module(void)
-{
- return i2c_bitvelle_init();
-}
-
-void cleanup_module(void)
-{
- i2c_bit_del_bus(&bit_velle_ops);
- bit_velle_exit();
-}
-
-#endif
+module_init(i2c_bitvelle_init);
+module_exit(i2c_bitvelle_exit);
diff -ruN linux-2.4.23-bk13/drivers/i2c/scx200_i2c.c linux-2.4.23-bk13-k1/drivers/i2c/scx200_i2c.c
--- linux-2.4.23-bk13/drivers/i2c/scx200_i2c.c Fri Jun 13 16:51:33 2003
+++ linux-2.4.23-bk13-k1/drivers/i2c/scx200_i2c.c Mon Dec 22 19:36:23 2003
@@ -110,7 +110,7 @@
.client_unregister = scx200_i2c_unreg,
};
-int scx200_i2c_init(void)
+static int __init scx200_i2c_init(void)
{
printk(KERN_DEBUG NAME ": NatSemi SCx200 I2C Driver\n");
@@ -140,7 +140,7 @@
return 0;
}
-void scx200_i2c_cleanup(void)
+static void __exit scx200_i2c_cleanup(void)
{
i2c_bit_del_bus(&scx200_i2c_ops);
}Quoted 4 lines
Quoted 2 lines
1* What is the reason for disabling
i2c_get_client? Is it in any way related to locks? To me it belongs to a different patch.Yes, it is missing locks. I'll add the locks instead.
OK, please do. That said, this function doesn't seem to be used much, if ever.
Quoted 9 lines
Quoted 5 lines
2* Your patch includes a large rewrite of
i2cproc_bus_read. How tightly is it related to locks? I see that the new version uses locks, but it also looks like this isn't the reason why the function was rewritten. If possible, we'd better split the patch in two pieces, one for the locks, and one for the rewrite.The inode will match only one adapter. This patch moves the real work outside the loop, after the correct adapter is found. Changed indent makes it look like a rewrite but it is not.
Yes, I could see that most of the code is the same indeed, shifted.
Still this doesn't fit into the "handle locks differently" goal of the patch, so I'll leave it apart from now. I understand that the function involves locks, but they are currently missing from the kernel's version so there is no regression here.
Quoted 5 lines
Quoted 3 lines
3* The argument name change in
i2c_smbus_xferdoesn't belong to this patch either. Is it OK to move it apart, or am I missing something?Well, it is
down(&adap->bus)in 2.8.2. That's why.
So it'll be down(&adapter->bus) for now ;)
Now I add another point:
4* What's the point in moving the "adapter->clients[i] = NULL" loop from top to bottom of function i2c_detach_client? This too makes much noise for nothing. If there is no special reason for doing so, let's reverse that change. If there is, this doesn't belong to this patch either.
Keep in mind that there's no problem submitting patches that do not fix everything related to a topic (here, locking) as long as what remains broken was still broken before (which is the case here).
With these four points moved apart, the patch is smaller and much more readable. We could merge everything that was left over, and possibly more, in a "general i2c-core cleanup" patch to be included in the next wave.
Quoted 3 lines
More patches on Saturday. These will include:
Fix
i2c_get_client.
Not a priority as far as I can tell. Who uses this?
Quoted 6 lines
Fix module reference counting to use
try_inc_mod_countin place of__MOD_INC_USE_COUNT, and havei2c_inc_use_clientreturn int. While this is an API change, the return code is just silently ignored. Fixi2c_use_clientto study the mentioned return code.Fix reference counting in i2c-dev open/close.
I'm not sure I get you here. Are these things already in CVS and to be ported to Linux 2.4, or the particular points that are broken in CVS which should be fixed before we can submit a clean patch for Linux 2.4? I really want the remaining CVS issues to be fixed and tested before we even think of backporting reference counting changes to Linux 2.4.
Thanks.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
I have a second patch on my stack, provided by Ky?sti. This is km1 (drop older kernels compatibility), reviewed, fixed and extended. Attached.
Patch is voluntarily generated with -U1 so that it won't fail if applied without the first patch. Since this patch only contains removals, no context is really needed.
Ky?sti, the next patch I'll push on my stack will be km3+km5. I've cleaned it up and fixed what needed to be so that it compiles and work fine, but there are three points I'd like to hear you about:
1* What is the reason for disabling i2c_get_client? Is it in any way related to locks? To me it belongs to a different patch.
2* Your patch includes a large rewrite of i2cproc_bus_read. How tightly is it related to locks? I see that the new version uses locks, but it also looks like this isn't the reason why the function was rewritten. If possible, we'd better split the patch in two pieces, one for the locks, and one for the rewrite.
3* The argument name change in i2c_smbus_xfer doesn't belong to this patch either. Is it OK to move it apart, or am I missing something?
No need to resend a patch, I'll make the updates by myself, providing you answer the questions above, so that I don't break anything. It is important that we provide patches that don't mix too much things, if we want them to be accepted.
Thanks.
Signature · 303 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
-------------- next part --------------
diff -U1 -r 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 2003-12-23 11:53:22.000000000 +0100
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-adap-ite.c 2003-12-23 13:43:26.000000000 +0100
@@ -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 -U1 -r 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 2003-12-23 11:53:22.000000000 +0100
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-bit.c 2003-12-23 13:45:50.000000000 +0100
@@ -29,3 +29,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
diff -U1 -r 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 2003-12-23 11:53:22.000000000 +0100
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-ite.c 2003-12-23 13:44:49.000000000 +0100
@@ -40,3 +40,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
diff -U1 -r 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 2003-12-23 11:53:22.000000000 +0100
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-algo-pcf.c 2003-12-23 13:45:44.000000000 +0100
@@ -33,3 +33,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
diff -U1 -r 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 2003-12-23 11:53:22.000000000 +0100
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-core.c 2003-12-23 13:45:36.000000000 +0100
@@ -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 -U1 -r 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 2003-12-23 11:53:22.000000000 +0100
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-dev.c 2003-12-23 13:45:27.000000000 +0100
@@ -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 -U1 -r 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 2003-12-23 11:53:22.000000000 +0100
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-elektor.c 2003-12-23 13:45:23.000000000 +0100
@@ -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 -U1 -r 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 2003-12-23 11:53:22.000000000 +0100
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-elv.c 2003-12-23 13:45:13.000000000 +0100
@@ -29,3 +29,2 @@
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/init.h>
diff -U1 -r 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 2002-11-29 00:53:13.000000000 +0100
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-keywest.c 2003-12-23 13:45:06.000000000 +0100
@@ -47,3 +47,2 @@
#include <linux/config.h>
-#include <linux/version.h>
#include <linux/kernel.h>
diff -U1 -r 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 2003-12-23 11:53:22.000000000 +0100
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-philips-par.c 2003-12-23 13:29:29.000000000 +0100
@@ -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 -U1 -r 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 2003-12-23 11:53:22.000000000 +0100
+++ linux-2.4.24-pre2-k2/drivers/i2c/i2c-proc.c 2003-12-23 13:44:58.000000000 +0100
@@ -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 -U1 -r 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 2003-06-13 16:51:38.000000000 +0200
+++ linux-2.4.24-pre2-k2/include/linux/i2c.h 2003-12-23 14:05:44.000000000 +0100
@@ -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 */Quoted 7 lines · Jean Delvare
I have a second patch on my stack, provided by Ky?sti. This is km1 (drop older kernels compatibility), reviewed, fixed and extended. Attached.
Patch is voluntarily generated with -U1 so that it won't fail if applied without the first patch. Since this patch only contains removals, no context is really needed.
Quoted 6 lines
Ky?sti, the next patch I'll push on my stack will be km3+km5. I've cleaned it up and fixed what needed to be so that it compiles and work fine, but there are three points I'd like to hear you about:
1* What is the reason for disabling
i2c_get_client? Is it in any way related to locks? To me it belongs to a different patch.
Yes, it is missing locks. I'll add the locks instead.
Quoted 5 lines
2* Your patch includes a large rewrite of
i2cproc_bus_read. How tightly is it related to locks? I see that the new version uses locks, but it also looks like this isn't the reason why the function was rewritten. If possible, we'd better split the patch in two pieces, one for the locks, and one for the rewrite.
The inode will match only one adapter. This patch moves the real work outside the loop, after the correct adapter is found. Changed indent makes it look like a rewrite but it is not.
Quoted 2 lines
3* The argument name change in
i2c_smbus_xferdoesn't belong to this patch either. Is it OK to move it apart, or am I missing something?
Well, it is down(&adap->bus) in 2.8.2. That's why.
More patches on Saturday. These will include:
Fix i2c_get_client.
Fix module reference counting to use try_inc_mod_count in place of __MOD_INC_USE_COUNT, and have i2c_inc_use_client return int. While this is an API change, the return code is just silently ignored. Fix i2c_use_client to study the mentioned return code.
Fix reference counting in i2c-dev open/close.
Signature · 1 line
Ky?sti M?lkki <[email protected]>
Quoted 4 lines · Jean Delvare
4* What's the point in moving the "adapter->clients[i] = NULL" loop from top to bottom of function
i2c_detach_client? This too makes much noise for nothing. If there is no special reason for doing so, let's reverse that change. If there is, this doesn't belong to this patch either.
Policy; have the list lock while making a change to it, on removal the race is not that dangerous but still worth a fix. Note the different return paths we should handle otherwise.
Postpone if you wish.
Quoted 8 lines
Quoted 4 lines
Fix module reference counting to use
try_inc_mod_countin place of__MOD_INC_USE_COUNT, and havei2c_inc_use_clientreturn int. While this is an API change, the return code is just silently ignored. Fixi2c_use_clientto study the mentioned return code.I'm not sure I get you here. Are these things already in CVS and to be ported to Linux 2.4, or the particular points that are broken in CVS which should be fixed before we can submit a clean patch for Linux 2.4?
This is about fixing the possible race while rmmoding, as the .owner field is (sometimes) initialized. The race is not yet fixed in CVS.
I will not import broken things from CVS with my patches.
I'm thinking whether to pass controlling_mod in i2c_register_entry as this is client->driver->owner. I would like to make this API change, remove it, for the sake of not changing lm_sensors chip drivers. Can you find anyone else using it?
Signature · 1 line
Ky?sti M?lkki <[email protected]>