PATCH: linux-2.4.9/drivers/i2o to new module_{init,exit} interface
The following patch moves the linux-2.4.9/drivers/i2o to
the new module_{init,exit} interface, removing i2o_init from drivers/block/genhd.c (a step toward removing that file) and simplifying the code considerably.
I'm not exactly sure where to send i2o patches, so I'm
posting them to linux-kernel. I would appreciate a pointer if there is a more specialized address for i2o patches.
Signature · 4 lines
Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 [email protected] \ / San Jose, California 95129-1034 +1 408 261-6630 | g g d r a s i l United States of America fax +1 408 261-6631 "Free Software For The Rest Of Us."
drivers/block/genhd.c +0 -4
@@ -28,16 +28,12 @@extern void console_map_init (void );extern int soc_probe (void );extern int atmdev_init (void ); -extern int i2o_init (void );extern int cpqarray_init (void );int __init device_init (void ) {blk_dev_init ();sti (); -#ifdef CONFIG_I2O -i2o_init (); -#endif #ifdef CONFIG_BLK_DEV_DAC960 DAC960_Initialize ();#endif
drivers/i2o/Config.in +1 -1
@@ -7,7 +7,7 @@ dep_tristate ' I2O PCI support' CONFIG_I2O_PCI $CONFIG_I2O fi dep_tristate ' I2O Block OSM' CONFIG_I2O_BLOCK $CONFIG_I2O -if [ "$CONFIG_NET" = "y" ]; then +if [ "$CONFIG_NET" != "n" ]; then dep_tristate ' I2O LAN OSM' CONFIG_I2O_LAN $CONFIG_I2O fi dep_tristate ' I2O SCSI OSM' CONFIG_I2O_SCSI $CONFIG_I2O $CONFIG_SCSI
drivers/i2o/i2o_block.c +5 -10
@@ -44,6 +44,7 @@#include <linux/module.h> +#include <linux/init.h> #include <linux/sched.h> #include <linux/fs.h> #include <linux/stat.h>
@@ -1875,10 +1876,6 @@* (Just smiley confuses emacs :-) */ -#ifdef MODULE -#define i2o_block_init init_module -#endif -int i2o_block_init (void ) {int i;
@@ -1895,9 +1892,7 @@ MAJOR_NR);return -EIO ; } -#ifdef MODULE printk (KERN_INFO "i2o_block: registered device at major %d\n" ,MAJOR_NR ); -#endif /* * Now fill in the boiler plate
@@ -1985,13 +1980,11 @@return 0 ; } -#ifdef MODULE -EXPORT_NO_SYMBOLS ;MODULE_AUTHOR ("Red Hat Software" );MODULE_DESCRIPTION ("I2O Block Device OSM" ); -void cleanup_module (void ) +static __exit void i2o_block_exit(void) {struct gendisk *gdp;int i;
@@ -2066,4 +2059,6 @@ } } } -#endif + +module_init (i2o_block_init); +module_exit (i2o_block_exit);
drivers/i2o/i2o_config.c +5 -10
@@ -908,11 +908,7 @@ &config_fops }; -#ifdef MODULE -int init_module(void) -#else int __init i2o_config_init (void ) -#endif {printk (KERN_INFO "I2O configuration manager v 0.04.\n" );printk (KERN_INFO " (C) Copyright 1999 Red Hat Software\n" );
@@ -945,10 +941,9 @@ i2o_cfg_context = cfg_handler.context;return 0 ; } +module_init (i2o_config_init); -#ifdef MODULE - -void cleanup_module (void ) +static __exit void i2o_config_exit(void) {misc_deregister (&i2o_miscdev);
@@ -957,9 +952,9 @@if (i2o_cfg_context !=-1 )i2o_remove_handler (&cfg_handler); } - + +module_exit (i2o_config_exit); +EXPORT_NO_SYMBOLS ;MODULE_AUTHOR ("Red Hat Software" );MODULE_DESCRIPTION ("I2O Configuration" ); - -#endif
drivers/i2o/i2o_core.c +4 -67
102 lines not on this page · raw message
drivers/i2o/i2o_lan.c +5 -9
@@ -1430,11 +1430,7 @@return dev; } -#ifdef MODULE -#define i2o_lan_init init_module -#endif - -int __init i2o_lan_init (void ) +static int __init i2o_lan_init (void ) {struct net_device *dev;int i;
@@ -1515,9 +1511,7 @@return 0 ; } -#ifdef MODULE - -void cleanup_module (void ) +static void __exit i2o_lan_exit(void) {int i;
@@ -1561,6 +1555,9 @@ }EXPORT_NO_SYMBOLS ; +module_init (i2o_lan_init); +module_exit (i2o_lan_exit); +MODULE_AUTHOR ("University of Helsinki, Department of Computer Science" );MODULE_DESCRIPTION ("I2O Lan OSM" );
@@ -1574,4 +1571,3 @@MODULE_PARM (tx_batch_mode,"0-2" "i" );MODULE_PARM_DESC (tx_batch_mode,"0=Send immediatelly, 1=Send in batches, 2=Switch automatically" ); -#endif
drivers/i2o/i2o_pci.c +6 -44
114 lines not on this page · raw message
drivers/i2o/i2o_proc.c +0 -2
@@ -3372,8 +3372,6 @@i2o_remove_handler (&i2o_proc_handler); } -#ifdef MODULE module_init (i2o_proc_init); -#endif module_exit (i2o_proc_exit);
Quoted 3 lines
I'm not exactly sure where to send i2o patches, so I'm
posting them to linux-kernel. I would appreciate a pointer if there is a more specialized address for i2o patches.
Me for i2o
drivers/block/genhd.c line 38
Quoted 6 lines
drivers/block/genhd.c +0
-3sti (); -#ifdef CONFIG_I2O -i2o_init (); -#endif #ifdef CONFIG_BLK_DEV_DAC960 DAC960_Initialize ();
Rejected. The ordering is critical because drivers may have both i2o and non i2o interfaces. Also an i2o card may control other pci devices and we will need to claim the resources beforehand when we finally support that.
drivers/i2o/Config.in line 10
Quoted 3 lines
dep_tristate' I2O Block OSM'CONFIG_I2O_BLOCK$CONFIG_I2Odrivers/i2o/Config.in +1
-1-if [ "$CONFIG_NET" = "y" ]; then +if [ "$CONFIG_NET" != "n" ]; then
NET cannot be modular
drivers/i2o/i2o_pci.c line 233
Quoted 5 lines
drivers/i2o/i2o_pci.c +0
-4-#ifdef MODULE i = core->install (c); -#else - i =i2o_install_controller (c); -#endif /* MODULE */
This changes all the module dependancy patterns - yes its right, no its not appropriate for a "stable" kernel.