Fromy: Randy Dunlap randy.dunlap@oracle.com
Fix two staging drivers to use module_init()/module_exit() instead of default init_module() and cleanup_module() function names so that there are no name conflicts when both are built-in.
drivers/staging/dt3155/built-in.o: In function `cleanup_module': (.text+0xc0): multiple definition of `cleanup_module' drivers/staging/batman-adv/built-in.o:(.text+0x330): first defined here drivers/staging/dt3155/built-in.o: In function `init_module': (.text+0xe60): multiple definition of `init_module' drivers/staging/batman-adv/built-in.o:(.text+0x400): first defined here
Signed-off-by: Randy Dunlap randy.dunlap@oracle.com Cc: Scott Smedley ss@aao.gov.au Cc: Marek Lindner lindner_marek@yahoo.de Cc: Simon Wunderlich siwu@hrz.tu-chemnitz.de Cc: Andrew Lunn andrew@lunn.ch Cc: b.a.t.m.a.n@lists.open-mesh.net Cc: Greg Kroah-Hartman <gregkh@suse.de --- drivers/staging/batman-adv/main.c | 7 +++++-- drivers/staging/dt3155/dt3155_drv.c | 23 ++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-)
--- linux-next-20100719.orig/drivers/staging/batman-adv/main.c +++ linux-next-20100719/drivers/staging/batman-adv/main.c @@ -59,7 +59,7 @@ static struct packet_type batman_adv_pac
struct workqueue_struct *bat_event_workqueue;
-int init_module(void) +int batman_init(void) { int retval;
@@ -131,7 +131,7 @@ end: return -ENOMEM; }
-void cleanup_module(void) +void batman_exit(void) { deactivate_module();
@@ -273,6 +273,9 @@ int is_mcast(uint8_t *addr) return *addr & 0x01; }
+module_init(batman_init); +module_exit(batman_exit); + MODULE_LICENSE("GPL");
MODULE_AUTHOR(DRIVER_AUTHOR); --- linux-next-20100719.orig/drivers/staging/dt3155/dt3155_drv.c +++ linux-next-20100719/drivers/staging/dt3155/dt3155_drv.c @@ -47,7 +47,7 @@ MA 02111-1307 USA + might want to get rid of MAXboards for allocating initial buffer. confusing and not necessary
- + in cleanup_module the MOD_IN_USE looks like it is check after it should + + in dt3155_exit the MOD_IN_USE looks like it is check after it should
* GFP_DMA should not be set with a PCI system (pg 291)
@@ -166,7 +166,7 @@ static void quick_stop (int minor) * * - looks like this isr supports IRQ sharing (or could) JML * - Assumes irq's are disabled, via SA_INTERRUPT flag - * being set in request_irq() call from init_module() + * being set in request_irq() call from dt3155_init() *****************************************************/ static void dt3155_isr(int irq, void *dev_id, struct pt_regs *regs) { @@ -836,7 +836,7 @@ dt3155_unlocked_ioctl(struct file *file,
/***************************************************** * file operations supported by DT3155 driver - * needed by init_module + * needed by dt3155_init * register_chrdev *****************************************************/ static struct file_operations dt3155_fops = { @@ -937,10 +937,8 @@ err:
u32 allocatorAddr = 0;
-/***************************************************** - * init_module() - *****************************************************/ -int init_module(void) + +int dt3155_init(void) { struct dt3155_status *dts; int index; @@ -1059,16 +1057,13 @@ int init_module(void) return 0; }
-/***************************************************** - * cleanup_module(void) - * - *****************************************************/ -void cleanup_module(void) + +void dt3155_exit(void) { struct dt3155_status *dts; int index;
- printk("DT3155: cleanup_module called\n"); + printk("DT3155: dt3155_exit called\n");
/* removed DMA allocated with the allocator */ #ifdef STANDALONE_ALLOCATOR @@ -1092,3 +1087,5 @@ void cleanup_module(void) } }
+module_init(dt3155_init); +module_exit(dt3155_exit);
Randy Dunlap wrote:
Fromy: Randy Dunlap randy.dunlap@oracle.com
Fix two staging drivers to use module_init()/module_exit() instead of default init_module() and cleanup_module() function names so that there are no name conflicts when both are built-in.
drivers/staging/dt3155/built-in.o: In function `cleanup_module': (.text+0xc0): multiple definition of `cleanup_module' drivers/staging/batman-adv/built-in.o:(.text+0x330): first defined here drivers/staging/dt3155/built-in.o: In function `init_module': (.text+0xe60): multiple definition of `init_module' drivers/staging/batman-adv/built-in.o:(.text+0x400): first defined here
Signed-off-by: Randy Dunlap randy.dunlap@oracle.com Cc: Scott Smedley ss@aao.gov.au Cc: Marek Lindner lindner_marek@yahoo.de Cc: Simon Wunderlich siwu@hrz.tu-chemnitz.de Cc: Andrew Lunn andrew@lunn.ch Cc: b.a.t.m.a.n@lists.open-mesh.net Cc: Greg Kroah-Hartman <gregkh@suse.de
@Randy Dunlap: Thanks a lot for your patch.
The Patch was splitted and added to maint. Can somebody please add it to trunk.
Best regards, Sven
From: Randy Dunlap randy.dunlap@oracle.com
Fix two staging drivers to use module_init()/module_exit() instead of default init_module() and cleanup_module() function names so that there are no name conflicts when both are built-in.
drivers/staging/dt3155/built-in.o: In function `cleanup_module': (.text+0xc0): multiple definition of `cleanup_module' drivers/staging/batman-adv/built-in.o:(.text+0x330): first defined here drivers/staging/dt3155/built-in.o: In function `init_module': (.text+0xe60): multiple definition of `init_module' drivers/staging/batman-adv/built-in.o:(.text+0x400): first defined here
Signed-off-by: Randy Dunlap randy.dunlap@oracle.com [sven.eckelmann@gmx.de: Mark module init and exit functions as static] Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de --- I send this patch again because I had to change the function heads again.
batman-adv/main.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/batman-adv/main.c b/batman-adv/main.c index 1b3acd1..b51917d 100644 --- a/batman-adv/main.c +++ b/batman-adv/main.c @@ -58,7 +58,7 @@ static struct packet_type batman_adv_packet_type __read_mostly = {
struct workqueue_struct *bat_event_workqueue;
-int init_module(void) +static int __init batman_init(void) { int retval;
@@ -127,7 +127,7 @@ end: return -ENOMEM; }
-void cleanup_module(void) +static void __init batman_exit(void) { deactivate_module();
@@ -270,6 +270,9 @@ int is_mcast(uint8_t *addr) return *addr & 0x01; }
+module_init(batman_init); +module_exit(batman_exit); + MODULE_LICENSE("GPL");
MODULE_AUTHOR(DRIVER_AUTHOR);
From: Randy Dunlap randy.dunlap@oracle.com
Fix two staging drivers to use module_init()/module_exit() instead of default init_module() and cleanup_module() function names so that there are no name conflicts when both are built-in.
drivers/staging/dt3155/built-in.o: In function `cleanup_module': (.text+0xc0): multiple definition of `cleanup_module' drivers/staging/batman-adv/built-in.o:(.text+0x330): first defined here drivers/staging/dt3155/built-in.o: In function `init_module': (.text+0xe60): multiple definition of `init_module' drivers/staging/batman-adv/built-in.o:(.text+0x400): first defined here
Signed-off-by: Randy Dunlap randy.dunlap@oracle.com [sven.eckelmann@gmx.de: Mark module init and exit functions as static] Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de --- ... and again due to a copy and paste error
batman-adv/main.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/batman-adv/main.c b/batman-adv/main.c index 1b3acd1..64925dc 100644 --- a/batman-adv/main.c +++ b/batman-adv/main.c @@ -58,7 +58,7 @@ static struct packet_type batman_adv_packet_type __read_mostly = {
struct workqueue_struct *bat_event_workqueue;
-int init_module(void) +static int __init batman_init(void) { int retval;
@@ -127,7 +127,7 @@ end: return -ENOMEM; }
-void cleanup_module(void) +static void __exit batman_exit(void) { deactivate_module();
@@ -270,6 +270,9 @@ int is_mcast(uint8_t *addr) return *addr & 0x01; }
+module_init(batman_init); +module_exit(batman_exit); + MODULE_LICENSE("GPL");
MODULE_AUTHOR(DRIVER_AUTHOR);
On Tuesday, July 20, 2010 23:46:19 Sven Eckelmann wrote:
Fix two staging drivers to use module_init()/module_exit() instead of default init_module() and cleanup_module() function names so that there are no name conflicts when both are built-in.
Applied in revision 1741.
Thanks, Marek
b.a.t.m.a.n@lists.open-mesh.org