[PATCH] compat: Fix module_init return type from void to int.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



086f3a1 overrode module_init to make it depend on compat, but the
overriding module_init has return type 'void', so strange things would
happen when the module loading code see that init_module() returns
positive values.  This patch makes it return the value returned by
the overriden module_init.

Signed-off-by: Nicolas Cavallari <cavallar@xxxxxx>
---
On 05/03/2012 22:50, Gmeiner Maximilian wrote:
> After compiling from the bleeding-edge without any errors this is what I get in kern.log when doing modprobe ath9k

I had the same problem with a completely different architecture and device,
and this patch fixed it.

diff --git a/include/linux/compat-2.6.h b/include/linux/compat-2.6.h
index bb00cd4..5715ce5 100644
--- a/include/linux/compat-2.6.h
+++ b/include/linux/compat-2.6.h
@@ -27,10 +27,10 @@ void compat_dependency_symbol(void);
 
 #undef module_init
 #define module_init(initfn)						\
-	static void __init __init_compat(void)				\
+	static int __init __init_compat(void)				\
 	{								\
 		compat_dependency_symbol();				\
-		initfn();						\
+		return initfn();					\
 	}								\
 	int init_module(void) __attribute__((alias("__init_compat")));
 
-- 
1.7.9

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux