Module called the exit module function "exit", This conflicts with the
stdlib header that use exit() to exit userspace program.
Correctly assign a namespace to these functions. (init and exit)
Fix compilation warning:
warning: the compiler differs from the one used to build the kernel
The kernel was built by: aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 12.2.0 r21757+608-
895f38ca1e) 12.2.0
You are using: aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 12.2.0 r21757+1091-
895f38ca1e) 12.2.0
CC [M] /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/gl-mifi-mcu-1/module.o
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/gl-mifi-mcu-1/module.c:196:20: error: conflicting types for built-in function 'exit'; expected 'void(int)' [-Werror=builtin-declaration-mismatch]
196 | static void __exit exit(void)
| ^~~~
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/gl-mifi-mcu-1/module.c:9:1: note: 'exit' is declared in header '<stdlib.h>'
8 | #include <linux/version.h>
+++ |+#include <stdlib.h>
9 |
cc1: all warnings being treated as errors
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
return result;
}
-static int __init init(void)
+static int __init gl_mifi_mcu_init(void)
{
bool success = true;
return success;
}
-static void __exit exit(void)
+static void __exit gl_mifi_mcu_exit(void)
{
disable_irq(gpio_to_irq(gpio_rx));
hrtimer_cancel(&timer_tx);
remove_proc_entry("gl_mifi_mcu", NULL);
}
-module_init(init);
-module_exit(exit);
+module_init(gl_mifi_mcu_init);
+module_exit(gl_mifi_mcu_exit);