Commit de9b9212 authored by Masatake YAMATO's avatar Masatake YAMATO Committed by Gustavo Padovan

Bluetooth: Added /proc/net/sco via bt_procfs_init()

Added /proc/net/sco via bt_procfs_init().
Signed-off-by: default avatarMasatake YAMATO <yamato@redhat.com>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent c6f5df16
...@@ -1023,6 +1023,13 @@ int __init sco_init(void) ...@@ -1023,6 +1023,13 @@ int __init sco_init(void)
goto error; goto error;
} }
err = bt_procfs_init(THIS_MODULE, &init_net, "sco", &sco_sk_list, NULL);
if (err < 0) {
BT_ERR("Failed to create SCO proc file");
bt_sock_unregister(BTPROTO_SCO);
goto error;
}
if (bt_debugfs) { if (bt_debugfs) {
sco_debugfs = debugfs_create_file("sco", 0444, bt_debugfs, sco_debugfs = debugfs_create_file("sco", 0444, bt_debugfs,
NULL, &sco_debugfs_fops); NULL, &sco_debugfs_fops);
...@@ -1041,6 +1048,8 @@ int __init sco_init(void) ...@@ -1041,6 +1048,8 @@ int __init sco_init(void)
void __exit sco_exit(void) void __exit sco_exit(void)
{ {
bt_procfs_cleanup(&init_net, "sco");
debugfs_remove(sco_debugfs); debugfs_remove(sco_debugfs);
if (bt_sock_unregister(BTPROTO_SCO) < 0) if (bt_sock_unregister(BTPROTO_SCO) < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment