7 -obj-$(CONFIG_COMPAT_FIRMWARE_CLASS) += compat_firmware_class.o
11 +ifdef CONFIG_COMPAT_FIRMWARE_CLASS
12 + compat-y += compat_firmware_class.o
15 # Compat kernel compatibility code
16 compat-$(CONFIG_COMPAT_KERNEL_2_6_14) += compat-2.6.14.o
17 compat-$(CONFIG_COMPAT_KERNEL_2_6_18) += compat-2.6.18.o
18 --- a/compat/compat_firmware_class.c
19 +++ b/compat/compat_firmware_class.c
20 @@ -729,19 +729,16 @@ request_firmware_nowait(
24 -static int __init firmware_class_init(void)
25 +int __init firmware_class_init(void)
27 return class_register(&firmware_class);
30 -static void __exit firmware_class_exit(void)
31 +void __exit firmware_class_exit(void)
33 class_unregister(&firmware_class);
36 -fs_initcall(firmware_class_init);
37 -module_exit(firmware_class_exit);
39 EXPORT_SYMBOL(release_firmware);
40 EXPORT_SYMBOL(request_firmware);
41 EXPORT_SYMBOL(request_firmware_nowait);
44 @@ -32,6 +32,17 @@ module_param(compat_version, charp, 0400
45 MODULE_PARM_DESC(compat_version,
46 "Version of the kernel compat backport work");
48 +#if defined(CONFIG_FW_LOADER) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
49 +int __init firmware_class_init(void);
50 +void __exit firmware_class_exit(void);
52 +static inline int firmware_class_init(void)
56 +static inline void firmware_class_exit(void) {}
59 static int __init compat_init(void)
61 /* pm-qos for kernels <= 2.6.24, this is a no-op on newer kernels */
62 @@ -45,15 +56,15 @@ static int __init compat_init(void)
63 COMPAT_BASE_TREE " " COMPAT_BASE_TREE_VERSION
67 + firmware_class_init();
70 module_init(compat_init);
72 static void __exit compat_exit(void)
74 compat_pm_qos_power_deinit();
77 + firmware_class_exit();
79 module_exit(compat_exit);