|
From: Gordon M. <gm...@us...> - 2001-03-07 18:12:36
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.141 1.142=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
--Added __init & __exit to module init & cleanup routines. The code is now =
properly initialized when included as part of a 2.4 kernel.
The diff of the modified file(s):
--- bluetooth.c 2001/03/07 16:52:52 1.141
+++ bluetooth.c 2001/03/07 18:13:48 1.142
@@ -50,6 +50,10 @@
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/timer.h>
+#include <linux/init.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
+#include <linux/kcomp.h>
+#endif
=20
#include <linux/bluetooth/bluetooth.h>
#include <linux/bluetooth/btcommon.h>
@@ -1231,6 +1235,7 @@
=20
/*
* Callback function when data is available at the tty driver.
+ * Context: timer task or (less likely) hard interrupt.
*/
=20=20
static void
@@ -1830,8 +1835,11 @@
/* Bluetooth Stack Initialization */
/**********************************/
=20
-s32
-bt_init(void)
+#if defined(MODULE) || defined(__KERNEL__)
+static int __init bt_init(void)
+#else
+s32 bt_init(void)
+#endif
{
static struct tty_ldisc bt_ldisc;
s32 status;
@@ -2536,16 +2544,10 @@
}
=20
/************************ MODULE STUFF ***********************************=
***/
-#ifdef MODULE
-s32
-init_module(void)
-{
- /* FIXME - check if serial module is loaded */
- return bt_init();
-}
+#if defined(MODULE) || defined(__KERNEL__)
=20
-void
-cleanup_module(void)=20
+static void
+__exit bt_exit(void)=20
{
unsigned long flags;
s32 error;
@@ -2591,6 +2593,8 @@
=20=09
DSYS("Bluetooth Driver unregistered\n");
}
+module_init(bt_init);
+module_exit(bt_exit);
#endif /* MODULE */
=20
/****************** END OF FILE bluetooth.c ******************************=
***/
|