make i2c use initcalls everywhere
Subsystems (3)
PATCH 1/1 make i2c use initcalls everywhere
The use of explicit initializers all over the i2c core anoyed for long, but the lm_sensors merge with two new files just for initializers was too much. Conver all of i2c to sane initialization (mostly initcall, but some driver also got other cleanups in that area)
drivers/Makefile +0 -2
@@ -38,8 +38,6 @@ obj-$(CONFIG_SERIO) += input/serio/ obj-$(CONFIG_I2O) += message/ obj-$(CONFIG_I2C) += i2c/ -obj-$(CONFIG_I2C_MAINBOARD) += i2c/busses/ -obj-$(CONFIG_SENSORS) += i2c/chips/ obj-$(CONFIG_PHONE) += telephony/ obj-$(CONFIG_MD) += md/ obj-$(CONFIG_BT) += bluetooth/
drivers/char/mem.c +0 -19
@@ -27,15 +27,6 @@#include <asm/io.h> #include <asm/pgalloc.h> -#ifdef CONFIG_I2C_MAINBOARD -extern void i2c_mainboard_init_all (void ); -#endif -#ifdef CONFIG_SENSORS -extern void sensors_init_all (void ); -#endif -#ifdef CONFIG_I2C -extern int i2c_init_all (void ); -#endif #ifdef CONFIG_FB extern void fbmem_init (void );#endif
@@ -708,12 +699,6 @@printk ("unable to get major %d for memory devs\n" ,MEM_MAJOR );memory_devfs_register ();rand_initialize (); -#ifdef CONFIG_I2C -i2c_init_all (); -#endif -#ifdef CONFIG_I2C_MAINBOARD -i2c_mainboard_init_all (); -#endif #if defined (CONFIG_FB )fbmem_init ();#endif
@@ -728,10 +713,6 @@#if defined(CONFIG_S390_TAPE ) && defined(CONFIG_S390_TAPE_CHAR )tapechar_init ();#endif -#ifdef CONFIG_SENSORS -sensors_init_all (); -#endif -return 0 ; }
drivers/i2c/Kconfig +0 -2
@@ -166,8 +166,6 @@ tristate "IBM on-chip I2C Adapter" depends on I2C_IBM_OCP_ALGO -# This is needed for automatic patch generation: sensors code starts here -# This is needed for automatic patch generation: sensors code ends here config I2C_CHARDEV tristate "I2C device interface" depends on I2C
drivers/i2c/Makefile +1 -3
@@ -18,6 +18,4 @@ obj-$(CONFIG_SCx200_I2C) += scx200_i2c.o obj-$(CONFIG_SCx200_ACB) += scx200_acb.o obj-$(CONFIG_I2C_PROC) += i2c-proc.o - -# This is needed for automatic patch generation: sensors code starts here -# This is needed for automatic patch generation: sensors code ends here +obj-y += busses/ chips/
drivers/i2c/i2c-algo-bit.c +0 -19
@@ -605,18 +605,9 @@return 0 ; } -int __init i2c_algo_bit_init (void ) -{ -printk (KERN_INFO "i2c-algo-bit.o: i2c bit algorithm module version %s (%s)\n" ,I2C_VERSION ,I2C_DATE ); -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" );
@@ -629,13 +620,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
drivers/i2c/i2c-algo-pcf.c +0 -19
@@ -520,17 +520,9 @@return 0 ; } -int __init i2c_algo_pcf_init (void ) -{ -printk (KERN_INFO "i2c-algo-pcf.o: i2c pcf8584 algorithm module version %s (%s)\n" ,I2C_VERSION ,I2C_DATE ); -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" );
@@ -541,14 +533,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
drivers/i2c/i2c-core.c +13 -155
241 lines not on this page · raw message
drivers/i2c/i2c-dev.c +4 -21
@@ -48,10 +48,6 @@#include <linux/i2c.h> #include <linux/i2c-dev.h> -int __init i2c_dev_init (void ); -void __exit i2c_dev_exit(void); -static int dev_cleanup (void ); -/* struct file_operations changed too often in the 2.1 series for nice code */ static ssize_t i2cdev_read (struct file *file, char *buf, size_t count,
@@ -437,19 +433,6 @@return -1 ; } -static int dev_cleanup (void ) -{ -int res; - -if ((res =i2c_del_driver (&i2cdev_driver))) { -printk (KERN_ERR "i2c-dev.o: Driver deregistration failed, " -"module not removed.\n" ); - } - -devfs_remove ("i2c" ); -unregister_chrdev (I2C_MAJOR ,"i2c" ); -} -int __init i2c_dev_init (void ) {int res;
@@ -471,12 +454,12 @@return 0 ; } -void __exit i2c_dev_exit(void) +static void __exit i2c_dev_exit(void) { -dev_cleanup (); +i2c_del_driver (&i2cdev_driver); +devfs_remove ("i2c" ); +unregister_chrdev (I2C_MAJOR ,"i2c" ); } - -EXPORT_NO_SYMBOLS ;MODULE_AUTHOR ("Frodo Looijaard <[email protected]> and Simon G. Vogl <[email protected]>" );MODULE_DESCRIPTION ("I2C /dev entries driver" );
drivers/i2c/i2c-elektor.c +28 -35
92 lines not on this page · raw message
drivers/i2c/i2c-elv.c +8 -20
@@ -113,11 +113,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 ;
@@ -166,7 +161,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 ) {
@@ -192,24 +187,17 @@return 0 ; } +static void __exit i2c_bitelv_exit(void) +{ +i2c_bit_del_bus (&bit_elv_ops); +release_region (base , (base ==0x3bc ) ?3 :8 ); +} -#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);
drivers/i2c/i2c-frodo.c +0 -7
@@ -96,8 +96,6 @@return (i2c_bit_add_bus (&frodo_ops)); } -EXPORT_NO_SYMBOLS ; - static void __exit i2c_frodo_exit (void) {i2c_bit_del_bus (&frodo_ops);
@@ -105,12 +103,7 @@MODULE_AUTHOR ("Abraham van der Merwe <[email protected]>" );MODULE_DESCRIPTION ("I2C-Bus adapter routines for Frodo" ); - -#ifdef MODULE_LICENSE MODULE_LICENSE ("GPL" ); -#endif /* #ifdef MODULE_LICENSE */ - -EXPORT_NO_SYMBOLS ;module_init (i2c_frodo_init);module_exit (i2c_frodo_exit);
drivers/i2c/i2c-philips-par.c +2 -11
@@ -297,14 +297,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);
drivers/i2c/i2c-proc.c +4 -20
@@ -40,10 +40,6 @@#define THIS_MODULE NULL#endif -int __init sensors_init (void ); -void __exit i2c_proc_exit(void); -static int proc_cleanup (void ); -static int i2c_create_name (char **name,const char *prefix,struct i2c_adapter *adapter,int addr); static int i2c_parse_reals(int *nrels, void *buffer, int bufsize,
@@ -92,7 +88,6 @@static struct ctl_table_header *i2c_proc_header; -static int i2c_initialized;/* This returns a nice name for a new directory; for example lm78-isa-0310 (for a LM78 chip on the ISA bus at port 0x310), or lm75-i2c-3-4e (for
@@ -848,10 +843,9 @@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 ;if (! (i2c_proc_header =register_sysctl_table (i2c_proc,0 ))) {
@@ -859,22 +853,12 @@return -EPERM ; } i2c_proc_header->ctl_table->child->de->owner =THIS_MODULE ; - i2c_initialized++;return 0 ; } -void __exit i2c_proc_exit(void) -{ -proc_cleanup (); -} - -static int proc_cleanup (void ) +static void __exit i2c_proc_exit(void) { -if (i2c_initialized >=1 ) { -unregister_sysctl_table (i2c_proc_header); - i2c_initialized--; - } -return 0 ; +unregister_sysctl_table (i2c_proc_header); }EXPORT_SYMBOL (i2c_deregister_entry);
@@ -887,5 +871,5 @@MODULE_DESCRIPTION ("i2c-proc driver" );MODULE_LICENSE ("GPL" ); -module_init (sensors_init); +module_init (i2c_proc_init);module_exit (i2c_proc_exit);
drivers/i2c/i2c-rpx.c +0 -3
@@ -126,11 +126,8 @@i2c_8xx_del_bus (&rpx_ops); } -#ifdef MODULE MODULE_AUTHOR ("Dan Malek <[email protected]>" );MODULE_DESCRIPTION ("I2C-Bus adapter routines for MPC8xx boards" );module_init (i2c_rpx_init);module_exit (i2c_rpx_exit); -#endif -
drivers/i2c/i2c-velleman.c +9 -20
@@ -102,12 +102,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 ;
@@ -157,7 +151,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 ) {
@@ -183,22 +177,17 @@return 0 ; } -#ifdef MODULE +static void __exit i2c_bitvelle_exit(void) +{ +i2c_bit_del_bus (&bit_velle_ops); +release_region (base, (base ==0x3bc ) ?3 :8 ); +} +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);
drivers/i2c/busses/Kconfig +0 -15
@@ -5,22 +5,8 @@ menu "I2C Hardware Sensors Mainboard support" -config I2C_MAINBOARD - bool "Hardware sensors mainboard support" - depends on EXPERIMENTAL && I2C && I2C_PROC - help - Many modern mainboards have some kind of I2C interface integrated. This - is often in the form of a SMBus, or System Management Bus, which is - basically the same as I2C but which uses only a subset of the I2C - protocol. - - You will also want the latest user-space utilties: you can find them - in the lm_sensors package, which you can download at - http://www.lm-sensors.nu - config I2C_AMD756 tristate " AMD 756/766" - depends on I2C_MAINBOARD help If you say yes to this option, support will be included for the AMD 756/766/768 mainboard I2C interfaces.
@@ -37,7 +23,6 @@ config I2C_AMD8111 tristate " AMD 8111" - depends on I2C_MAINBOARD help If you say yes to this option, support will be included for the AMD 8111 mainboard I2C interfaces.
drivers/i2c/busses/Makefile +1 -36
@@ -2,6 +2,5 @@ # Makefile for the kernel hardware sensors bus drivers. # -obj-$(CONFIG_I2C_MAINBOARD) += i2c-mainboard.o obj-$(CONFIG_I2C_AMD756) += i2c-amd756.o --- 1.1/drivers/i2c/busses/i2c-mainboard.c Sun Dec 1 19:42:06 2002 +++ edited/drivers/i2c/busses/i2c-mainboard.c Sun Dec 29 18:10:37 2002
@@ -1,34 +0,0 @@ -/* - i2c-mainboard.c - Part of lm_sensors, Linux kernel modules for hardware - monitoring - Copyright (c) 1998, 1999 Frodo Looijaard <[email protected]> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* Not configurable as a module */ - -#include <linux/init.h> - -extern int i2c_amd756_init(void); - -int __init i2c_mainboard_init_all(void) -{ -#ifdef CONFIG_I2C_AMD756 - i2c_amd756_init(); -#endif - - return 0; -}
drivers/i2c/chips/Kconfig +0 -16
@@ -5,22 +5,8 @@ menu "I2C Hardware Sensors Chip support" -config SENSORS - bool "Hardware sensors chip support" - depends on EXPERIMENTAL && I2C && I2C_PROC - help - Many modern mainboards have some kind of I2C interface integrated. - This is often in the form of a SMBus, or System Management Bus, which - is basically the same as I2C but which uses only a subset of the I2C - protocol. - - You will also want the latest user-space utilties: you can find them - in the lm_sensors package, which you can download at - http://www.lm-sensors.nu - config SENSORS_ADM1021 tristate " Analog Devices ADM1021 and compatibles" - depends on SENSORS help If you say yes here you get support for Analog Devices ADM1021 and ADM1023 sensor chips and clones: Maxim MAX1617 and MAX1617A,
@@ -37,7 +23,6 @@ config SENSORS_LM75 tristate " National Semiconductors LM75 and compatibles" - depends on SENSORS help If you say yes here you get support for National Semiconductor LM75 sensor chips and clones: Dallas Semi DS75 and DS1775, TelCon
@@ -51,4 +36,3 @@ http://www.lm-sensors.nu endmenu -
drivers/i2c/chips/Makefile +0 -1
@@ -2,6 +2,5 @@ # Makefile for the kernel hardware sensors chip drivers. # -obj-$(CONFIG_SENSORS) += sensors.o obj-$(CONFIG_SENSORS_ADM1021) += adm1021.o obj-$(CONFIG_SENSORS_LM75) += lm75.o
drivers/i2c/chips/adm1021.c +5 -38
77 lines not on this page · raw message
drivers/i2c/chips/lm75.c +6 -48
97 lines not on this page · raw message
drivers/i2c/chips/sensors.c +0 -37
@@ -1,37 +0,0 @@ -/* -sensors.c - Part of lm_sensors, Linux kernel modules for hardware -monitoring -Copyright (c) 1998, 1999 Frodo Looijaard <[email protected]> - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* Not configurable as a module */ - -#include <linux/init.h> - -extern int sensors_adm1021_init (void ); -extern int sensors_lm75_init (void ); - -int __init sensors_init_all (void ) -{ -#ifdef CONFIG_SENSORS_ADM1021 -sensors_adm1021_init (); -#endif -#ifdef CONFIG_SENSORS_LM75 -sensors_lm75_init (); -#endif -return 0 ; -}
Quoted 5 lines · On 2002.12.29 Christoph Hellwig wrote:
The use of explicit initializers all over the i2c core anoyed for long, but the
lm_sensorsmerge with two new files just for initializers was too much. Conver all of i2c to sane initialization (mostly initcall, but some driver also got other cleanups in that area)
Wil this reach the i2c maintainer or the next auto-generated patch from i2c 2.8.x will undo what you do now and will be sized 4Gb ?
Will i2c ever get in sync into 2.4 ? Nowadays the main of the patch is a ton of 'stupid' changes from printk(xxx) to I2C_DEBUG(xxx) or the like. Will this be accepted if I submit it, even independently of the maintainer ? Because I suppose (???) that maintainer is sending changes and they are going to trash...
Signature · 4 lines
J.A. Magallon <[email protected]> \ Software is like sex: werewolf.able.es \ It's better when it's free Mandrake Linux release 9.1 (Cooker) for i586 Linux 2.4.21-pre2-jam2 (gcc 3.2.1 (Mandrake Linux 9.1 3.2.1-2mdk))
Quoted 2 lines · J.A. Magallon
Wil this reach the i2c maintainer or the next auto-generated patch from i2c 2.8.x will undo what you do now and will be sized 4Gb ?
There is no maintainer for drivers/i2c/. The only updates it every got was me syncinc with their releases and backing out obvious braindamage.
Quoted 3 lines
Will this be accepted if I submit it, even independently of the maintainer ? Because I suppose (???) that maintainer is sending changes and they are going to trash...
Maybe the changes the maintainers of the external i2c code are sending _are_ trash?
Quoted 7 lines · On 2002.12.29 Christoph Hellwig wrote:
Quoted 2 lines · J.A. Magallon
Wil this reach the i2c maintainer or the next auto-generated patch from i2c 2.8.x will undo what you do now and will be sized 4Gb ?
There is no maintainer for
drivers/i2c/. The only updates it every got was me syncinc with their releases and backing out obvious braindamage.
Quoted 7 lines
Quoted 3 lines
Will this be accepted if I submit it, even independently of the maintainer ? Because I suppose (???) that maintainer is sending changes and they are going to trash...
Maybe the changes the maintainers of the external i2c code are sending _are_ trash?
(just put on the flame war suit...)
Stupid question: why people on http://secure.netroedge.com/~lm78/ is not smashed with a hammer on the head and 'morally forced' to post, comment, etc. patches on LKML ? They continue to ship releases, every vendor tracks them, and every vendor has to correct changes they have not tracked from mainline, like that old about __exit functions, and now initcalls...
I really do not understand some things about Linux. Some people look like living in alternative universes...
Signature · 4 lines
J.A. Magallon <[email protected]> \ Software is like sex: werewolf.able.es \ It's better when it's free Mandrake Linux release 9.1 (Cooker) for i586 Linux 2.4.21-pre2-jam2 (gcc 3.2.1 (Mandrake Linux 9.1 3.2.1-2mdk))
Agreed. I would love to see the i2c and lmsensor stuff properly maintained in the kernel tree; It would save a whole lot of dicking around.
Pretty please? ;)
Quoted 31 lines · J.A. Magallon
Quoted 9 lines · On 2002.12.29 Christoph Hellwig wrote:
Quoted 2 lines · J.A. Magallon
Wil this reach the i2c maintainer or the next auto-generated patch from i2c 2.8.x will undo what you do now and will be sized 4Gb ?
There is no maintainer for
drivers/i2c/. The only updates it every got was me syncinc with their releases and backing out obvious braindamage.Quoted 7 lines
Quoted 3 lines
Will this be accepted if I submit it, even independently of the maintainer ? Because I suppose (???) that maintainer is sending changes and they are going to trash...
Maybe the changes the maintainers of the external i2c code are sending _are_ trash?
(just put on the flame war suit...)
Stupid question: why people on http://secure.netroedge.com/~lm78/ is not smashed with a hammer on the head and 'morally forced' to post, comment, etc. patches on LKML ? They continue to ship releases, every vendor tracks them, and every vendor has to correct changes they have not tracked from mainline, like that old about
__exitfunctions, and now initcalls...I really do not understand some things about Linux. Some people look like living in alternative universes...