2011-08-01 17:42:00 +00:00
|
|
|
--- a/compat/Makefile
|
|
|
|
+++ b/compat/Makefile
|
|
|
|
@@ -1,10 +1,13 @@
|
|
|
|
obj-m += compat.o
|
|
|
|
#compat-objs :=
|
|
|
|
|
|
|
|
-obj-$(CONFIG_COMPAT_FIRMWARE_CLASS) += compat_firmware_class.o
|
|
|
|
|
|
|
|
compat-y += main.o
|
|
|
|
|
|
|
|
+ifdef CONFIG_COMPAT_FIRMWARE_CLASS
|
|
|
|
+ compat-y += compat_firmware_class.o
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
# Compat kernel compatibility code
|
|
|
|
compat-$(CONFIG_COMPAT_KERNEL_2_6_14) += compat-2.6.14.o
|
|
|
|
compat-$(CONFIG_COMPAT_KERNEL_2_6_18) += compat-2.6.18.o
|
2011-08-01 17:52:07 +00:00
|
|
|
--- a/compat/compat_firmware_class.c
|
|
|
|
+++ b/compat/compat_firmware_class.c
|
|
|
|
@@ -729,19 +729,16 @@ request_firmware_nowait(
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int __init firmware_class_init(void)
|
|
|
|
+int __init firmware_class_init(void)
|
|
|
|
{
|
|
|
|
return class_register(&firmware_class);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void __exit firmware_class_exit(void)
|
|
|
|
+void __exit firmware_class_exit(void)
|
|
|
|
{
|
|
|
|
class_unregister(&firmware_class);
|
|
|
|
}
|
|
|
|
|
|
|
|
-fs_initcall(firmware_class_init);
|
|
|
|
-module_exit(firmware_class_exit);
|
|
|
|
-
|
|
|
|
EXPORT_SYMBOL(release_firmware);
|
|
|
|
EXPORT_SYMBOL(request_firmware);
|
|
|
|
EXPORT_SYMBOL(request_firmware_nowait);
|
|
|
|
--- a/compat/main.c
|
|
|
|
+++ b/compat/main.c
|
2011-08-01 21:14:15 +00:00
|
|
|
@@ -32,6 +32,17 @@ module_param(compat_version, charp, 0400
|
2011-08-01 17:52:07 +00:00
|
|
|
MODULE_PARM_DESC(compat_version,
|
|
|
|
"Version of the kernel compat backport work");
|
|
|
|
|
|
|
|
+#if defined(CONFIG_FW_LOADER) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
|
|
|
|
+int __init firmware_class_init(void);
|
|
|
|
+void __exit firmware_class_exit(void);
|
|
|
|
+#else
|
2011-08-01 21:14:15 +00:00
|
|
|
+static inline int firmware_class_init(void)
|
|
|
|
+{
|
|
|
|
+ return 0;
|
|
|
|
+}
|
2011-08-01 17:52:07 +00:00
|
|
|
+static inline void firmware_class_exit(void) {}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
static int __init compat_init(void)
|
|
|
|
{
|
|
|
|
/* pm-qos for kernels <= 2.6.24, this is a no-op on newer kernels */
|
2011-11-18 11:27:19 +00:00
|
|
|
@@ -46,7 +57,8 @@ static int __init compat_init(void)
|
2011-08-01 17:52:07 +00:00
|
|
|
COMPAT_BASE_TREE " " COMPAT_BASE_TREE_VERSION
|
|
|
|
"\n");
|
|
|
|
|
|
|
|
- return 0;
|
|
|
|
+ firmware_class_init();
|
|
|
|
+ return 0;
|
|
|
|
}
|
|
|
|
module_init(compat_init);
|
|
|
|
|
2011-11-18 11:27:19 +00:00
|
|
|
@@ -55,7 +67,8 @@ static void __exit compat_exit(void)
|
2011-08-01 17:52:07 +00:00
|
|
|
compat_pm_qos_power_deinit();
|
2011-11-18 11:27:19 +00:00
|
|
|
compat_system_workqueue_destroy();
|
|
|
|
|
2011-08-01 17:52:07 +00:00
|
|
|
- return;
|
|
|
|
+ firmware_class_exit();
|
2011-11-18 11:27:19 +00:00
|
|
|
+ return;
|
2011-08-01 17:52:07 +00:00
|
|
|
}
|
|
|
|
module_exit(compat_exit);
|
|
|
|
|