Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
05b9ae6f
Commit
05b9ae6f
authored
Feb 19, 2003
by
Maksim Krasnyanskiy
Committed by
Marcel Holtmann
Feb 19, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bluetooth]
Cleanup and fix __init and __exit functions. /proc/bluetooth initialization fixes.
parent
a1ba2826
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
41 additions
and
34 deletions
+41
-34
net/bluetooth/af_bluetooth.c
net/bluetooth/af_bluetooth.c
+3
-1
net/bluetooth/bnep/core.c
net/bluetooth/bnep/core.c
+1
-1
net/bluetooth/bnep/sock.c
net/bluetooth/bnep/sock.c
+2
-2
net/bluetooth/hci_proc.c
net/bluetooth/hci_proc.c
+3
-3
net/bluetooth/hci_sock.c
net/bluetooth/hci_sock.c
+2
-2
net/bluetooth/l2cap.c
net/bluetooth/l2cap.c
+6
-5
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/core.c
+12
-9
net/bluetooth/rfcomm/sock.c
net/bluetooth/rfcomm/sock.c
+6
-6
net/bluetooth/sco.c
net/bluetooth/sco.c
+6
-5
No files found.
net/bluetooth/af_bluetooth.c
View file @
05b9ae6f
...
@@ -335,7 +335,9 @@ static int __init bt_init(void)
...
@@ -335,7 +335,9 @@ static int __init bt_init(void)
BT_INFO
(
"Core ver %s"
,
VERSION
);
BT_INFO
(
"Core ver %s"
,
VERSION
);
proc_bt
=
proc_mkdir
(
"bluetooth"
,
NULL
);
proc_bt
=
proc_mkdir
(
"bluetooth"
,
NULL
);
if
(
proc_bt
)
proc_bt
->
owner
=
THIS_MODULE
;
/* Init socket cache */
/* Init socket cache */
bt_sock_cache
=
kmem_cache_create
(
"bt_sock"
,
bt_sock_cache
=
kmem_cache_create
(
"bt_sock"
,
sizeof
(
struct
bt_sock
),
0
,
sizeof
(
struct
bt_sock
),
0
,
...
...
net/bluetooth/bnep/core.c
View file @
05b9ae6f
...
@@ -700,7 +700,7 @@ int bnep_get_conninfo(struct bnep_conninfo *ci)
...
@@ -700,7 +700,7 @@ int bnep_get_conninfo(struct bnep_conninfo *ci)
return
err
;
return
err
;
}
}
static
int
__init
bnep_init_module
(
void
)
static
int
__init
bnep_init_module
(
void
)
{
{
char
flt
[
50
]
=
""
;
char
flt
[
50
]
=
""
;
...
...
net/bluetooth/bnep/sock.c
View file @
05b9ae6f
...
@@ -192,13 +192,13 @@ static struct net_proto_family bnep_sock_family_ops = {
...
@@ -192,13 +192,13 @@ static struct net_proto_family bnep_sock_family_ops = {
.
create
=
bnep_sock_create
.
create
=
bnep_sock_create
};
};
int
bnep_sock_init
(
void
)
int
__init
bnep_sock_init
(
void
)
{
{
bt_sock_register
(
BTPROTO_BNEP
,
&
bnep_sock_family_ops
);
bt_sock_register
(
BTPROTO_BNEP
,
&
bnep_sock_family_ops
);
return
0
;
return
0
;
}
}
int
bnep_sock_cleanup
(
void
)
int
__exit
bnep_sock_cleanup
(
void
)
{
{
if
(
bt_sock_unregister
(
BTPROTO_BNEP
))
if
(
bt_sock_unregister
(
BTPROTO_BNEP
))
BT_ERR
(
"Can't unregister BNEP socket"
);
BT_ERR
(
"Can't unregister BNEP socket"
);
...
...
net/bluetooth/hci_proc.c
View file @
05b9ae6f
...
@@ -151,13 +151,13 @@ void hci_dev_proc_cleanup(struct hci_dev *hdev)
...
@@ -151,13 +151,13 @@ void hci_dev_proc_cleanup(struct hci_dev *hdev)
remove_proc_entry
(
id
,
proc_bt_hci
);
remove_proc_entry
(
id
,
proc_bt_hci
);
}
}
int
__init
hci_proc_init
(
void
)
int
__init
hci_proc_init
(
void
)
{
{
proc_bt_hci
=
proc_mkdir
(
"hci"
,
proc_bt
);
proc_bt_hci
=
proc_mkdir
(
"hci"
,
proc_bt
);
return
0
;
return
0
;
}
}
void
__
in
it
hci_proc_cleanup
(
void
)
void
__
ex
it
hci_proc_cleanup
(
void
)
{
{
remove_proc_entry
(
"hci"
,
proc_bt
);
remove_proc_entry
(
"hci"
,
proc_bt
);
}
}
...
@@ -179,7 +179,7 @@ int __init hci_proc_init(void)
...
@@ -179,7 +179,7 @@ int __init hci_proc_init(void)
return
0
;
return
0
;
}
}
void
__
in
it
hci_proc_cleanup
(
void
)
void
__
ex
it
hci_proc_cleanup
(
void
)
{
{
return
;
return
;
}
}
...
...
net/bluetooth/hci_sock.c
View file @
05b9ae6f
...
@@ -625,7 +625,7 @@ struct notifier_block hci_sock_nblock = {
...
@@ -625,7 +625,7 @@ struct notifier_block hci_sock_nblock = {
.
notifier_call
=
hci_sock_dev_event
.
notifier_call
=
hci_sock_dev_event
};
};
int
hci_sock_init
(
void
)
int
__init
hci_sock_init
(
void
)
{
{
if
(
bt_sock_register
(
BTPROTO_HCI
,
&
hci_sock_family_ops
))
{
if
(
bt_sock_register
(
BTPROTO_HCI
,
&
hci_sock_family_ops
))
{
BT_ERR
(
"HCI socket registration failed"
);
BT_ERR
(
"HCI socket registration failed"
);
...
@@ -639,7 +639,7 @@ int hci_sock_init(void)
...
@@ -639,7 +639,7 @@ int hci_sock_init(void)
return
0
;
return
0
;
}
}
int
hci_sock_cleanup
(
void
)
int
__exit
hci_sock_cleanup
(
void
)
{
{
if
(
bt_sock_unregister
(
BTPROTO_HCI
))
if
(
bt_sock_unregister
(
BTPROTO_HCI
))
BT_ERR
(
"HCI socket unregistration failed"
);
BT_ERR
(
"HCI socket unregistration failed"
);
...
...
net/bluetooth/l2cap.c
View file @
05b9ae6f
...
@@ -2054,28 +2054,29 @@ static struct file_operations l2cap_seq_fops = {
...
@@ -2054,28 +2054,29 @@ static struct file_operations l2cap_seq_fops = {
.
release
=
seq_release
,
.
release
=
seq_release
,
};
};
static
int
__init
l2cap_proc_init
(
void
)
static
int
__init
l2cap_proc_init
(
void
)
{
{
struct
proc_dir_entry
*
p
=
create_proc_entry
(
"l2cap"
,
S_IRUGO
,
proc_bt
);
struct
proc_dir_entry
*
p
=
create_proc_entry
(
"l2cap"
,
S_IRUGO
,
proc_bt
);
if
(
!
p
)
if
(
!
p
)
return
-
ENOMEM
;
return
-
ENOMEM
;
p
->
owner
=
THIS_MODULE
;
p
->
proc_fops
=
&
l2cap_seq_fops
;
p
->
proc_fops
=
&
l2cap_seq_fops
;
return
0
;
return
0
;
}
}
static
void
__
in
it
l2cap_proc_cleanup
(
void
)
static
void
__
ex
it
l2cap_proc_cleanup
(
void
)
{
{
remove_proc_entry
(
"l2cap"
,
proc_bt
);
remove_proc_entry
(
"l2cap"
,
proc_bt
);
}
}
#else
/* CONFIG_PROC_FS */
#else
/* CONFIG_PROC_FS */
static
int
__init
l2cap_proc_init
(
void
)
static
int
__init
l2cap_proc_init
(
void
)
{
{
return
0
;
return
0
;
}
}
static
void
__
in
it
l2cap_proc_cleanup
(
void
)
static
void
__
ex
it
l2cap_proc_cleanup
(
void
)
{
{
return
;
return
;
}
}
...
@@ -2139,7 +2140,7 @@ int __init l2cap_init(void)
...
@@ -2139,7 +2140,7 @@ int __init l2cap_init(void)
return
0
;
return
0
;
}
}
void
l2cap_cleanup
(
void
)
void
__exit
l2cap_cleanup
(
void
)
{
{
l2cap_proc_cleanup
();
l2cap_proc_cleanup
();
...
...
net/bluetooth/rfcomm/core.c
View file @
05b9ae6f
...
@@ -1803,19 +1803,22 @@ static struct file_operations rfcomm_seq_fops = {
...
@@ -1803,19 +1803,22 @@ static struct file_operations rfcomm_seq_fops = {
.
release
=
seq_release
,
.
release
=
seq_release
,
};
};
static
int
__init
rfcomm_proc_init
(
void
)
static
int
__init
rfcomm_proc_init
(
void
)
{
{
struct
proc_dir_entry
*
p
;
struct
proc_dir_entry
*
p
;
proc_bt_rfcomm
=
proc_mkdir
(
"rfcomm"
,
proc_bt
);
proc_bt_rfcomm
=
proc_mkdir
(
"rfcomm"
,
proc_bt
);
if
(
proc_bt_rfcomm
)
{
proc_bt_rfcomm
->
owner
=
THIS_MODULE
;
p
=
create_proc_entry
(
"dlc"
,
S_IRUGO
,
proc_bt_rfcomm
);
p
=
create_proc_entry
(
"dlc"
,
S_IRUGO
,
proc_bt_rfcomm
);
if
(
p
)
if
(
p
)
p
->
proc_fops
=
&
rfcomm_seq_fops
;
p
->
proc_fops
=
&
rfcomm_seq_fops
;
}
return
0
;
return
0
;
}
}
static
void
__
in
it
rfcomm_proc_cleanup
(
void
)
static
void
__
ex
it
rfcomm_proc_cleanup
(
void
)
{
{
remove_proc_entry
(
"dlc"
,
proc_bt_rfcomm
);
remove_proc_entry
(
"dlc"
,
proc_bt_rfcomm
);
...
@@ -1824,19 +1827,19 @@ static void __init rfcomm_proc_cleanup(void)
...
@@ -1824,19 +1827,19 @@ static void __init rfcomm_proc_cleanup(void)
#else
/* CONFIG_PROC_FS */
#else
/* CONFIG_PROC_FS */
static
int
__init
rfcomm_proc_init
(
void
)
static
int
__init
rfcomm_proc_init
(
void
)
{
{
return
0
;
return
0
;
}
}
static
void
__
in
it
rfcomm_proc_cleanup
(
void
)
static
void
__
ex
it
rfcomm_proc_cleanup
(
void
)
{
{
return
;
return
;
}
}
#endif
/* CONFIG_PROC_FS */
#endif
/* CONFIG_PROC_FS */
/* ---- Initialization ---- */
/* ---- Initialization ---- */
int
__init
rfcomm_init
(
void
)
int
__init
rfcomm_init
(
void
)
{
{
kernel_thread
(
rfcomm_run
,
NULL
,
CLONE_FS
|
CLONE_FILES
|
CLONE_SIGHAND
);
kernel_thread
(
rfcomm_run
,
NULL
,
CLONE_FS
|
CLONE_FILES
|
CLONE_SIGHAND
);
...
@@ -1853,7 +1856,7 @@ int __init rfcomm_init(void)
...
@@ -1853,7 +1856,7 @@ int __init rfcomm_init(void)
return
0
;
return
0
;
}
}
void
rfcomm_cleanup
(
void
)
void
__exit
rfcomm_cleanup
(
void
)
{
{
/* Terminate working thread.
/* Terminate working thread.
* ie. Set terminate flag and wake it up */
* ie. Set terminate flag and wake it up */
...
...
net/bluetooth/rfcomm/sock.c
View file @
05b9ae6f
...
@@ -828,7 +828,7 @@ static struct file_operations rfcomm_seq_fops = {
...
@@ -828,7 +828,7 @@ static struct file_operations rfcomm_seq_fops = {
.
release
=
seq_release
,
.
release
=
seq_release
,
};
};
static
int
__init
rfcomm_sock_proc_init
(
void
)
static
int
__init
rfcomm_sock_proc_init
(
void
)
{
{
struct
proc_dir_entry
*
p
=
create_proc_entry
(
"sock"
,
S_IRUGO
,
proc_bt_rfcomm
);
struct
proc_dir_entry
*
p
=
create_proc_entry
(
"sock"
,
S_IRUGO
,
proc_bt_rfcomm
);
if
(
!
p
)
if
(
!
p
)
...
@@ -837,19 +837,19 @@ static int __init rfcomm_sock_proc_init(void)
...
@@ -837,19 +837,19 @@ static int __init rfcomm_sock_proc_init(void)
return
0
;
return
0
;
}
}
static
void
__
in
it
rfcomm_sock_proc_cleanup
(
void
)
static
void
__
ex
it
rfcomm_sock_proc_cleanup
(
void
)
{
{
remove_proc_entry
(
"sock"
,
proc_bt_rfcomm
);
remove_proc_entry
(
"sock"
,
proc_bt_rfcomm
);
}
}
#else
/* CONFIG_PROC_FS */
#else
/* CONFIG_PROC_FS */
static
int
__init
rfcomm_sock_proc_init
(
void
)
static
int
__init
rfcomm_sock_proc_init
(
void
)
{
{
return
0
;
return
0
;
}
}
static
void
__
in
it
rfcomm_sock_proc_cleanup
(
void
)
static
void
__
ex
it
rfcomm_sock_proc_cleanup
(
void
)
{
{
return
;
return
;
}
}
...
@@ -879,7 +879,7 @@ static struct net_proto_family rfcomm_sock_family_ops = {
...
@@ -879,7 +879,7 @@ static struct net_proto_family rfcomm_sock_family_ops = {
.
create
=
rfcomm_sock_create
.
create
=
rfcomm_sock_create
};
};
int
rfcomm_init_sockets
(
void
)
int
__init
rfcomm_init_sockets
(
void
)
{
{
int
err
;
int
err
;
...
@@ -894,7 +894,7 @@ int rfcomm_init_sockets(void)
...
@@ -894,7 +894,7 @@ int rfcomm_init_sockets(void)
return
0
;
return
0
;
}
}
void
rfcomm_cleanup_sockets
(
void
)
void
__exit
rfcomm_cleanup_sockets
(
void
)
{
{
int
err
;
int
err
;
...
...
net/bluetooth/sco.c
View file @
05b9ae6f
...
@@ -939,28 +939,29 @@ static struct file_operations sco_seq_fops = {
...
@@ -939,28 +939,29 @@ static struct file_operations sco_seq_fops = {
.
release
=
seq_release
,
.
release
=
seq_release
,
};
};
static
int
__init
sco_proc_init
(
void
)
static
int
__init
sco_proc_init
(
void
)
{
{
struct
proc_dir_entry
*
p
=
create_proc_entry
(
"sco"
,
S_IRUGO
,
proc_bt
);
struct
proc_dir_entry
*
p
=
create_proc_entry
(
"sco"
,
S_IRUGO
,
proc_bt
);
if
(
!
p
)
if
(
!
p
)
return
-
ENOMEM
;
return
-
ENOMEM
;
p
->
owner
=
THIS_MODULE
;
p
->
proc_fops
=
&
sco_seq_fops
;
p
->
proc_fops
=
&
sco_seq_fops
;
return
0
;
return
0
;
}
}
static
void
__
in
it
sco_proc_cleanup
(
void
)
static
void
__
ex
it
sco_proc_cleanup
(
void
)
{
{
remove_proc_entry
(
"sco"
,
proc_bt
);
remove_proc_entry
(
"sco"
,
proc_bt
);
}
}
#else
/* CONFIG_PROC_FS */
#else
/* CONFIG_PROC_FS */
static
int
__init
sco_proc_init
(
void
)
static
int
__init
sco_proc_init
(
void
)
{
{
return
0
;
return
0
;
}
}
static
void
__
in
it
sco_proc_cleanup
(
void
)
static
void
__
ex
it
sco_proc_cleanup
(
void
)
{
{
return
;
return
;
}
}
...
@@ -1021,7 +1022,7 @@ int __init sco_init(void)
...
@@ -1021,7 +1022,7 @@ int __init sco_init(void)
return
0
;
return
0
;
}
}
void
sco_cleanup
(
void
)
void
__exit
sco_cleanup
(
void
)
{
{
int
err
;
int
err
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment