Bluetooth: Added /proc/net/sco via bt_procfs_init()
authorMasatake YAMATO <yamato@redhat.com>
Wed, 25 Jul 2012 16:30:12 +0000 (01:30 +0900)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Mon, 6 Aug 2012 18:03:00 +0000 (15:03 -0300)
Added /proc/net/sco via bt_procfs_init().

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/sco.c

index 0ef5a78a889f8328fbc2489a8994f21ce4202870..caa109df645292a0a59e78be01e39a64ce8f90c5 100644 (file)
@@ -1023,6 +1023,13 @@ int __init sco_init(void)
                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) {
                sco_debugfs = debugfs_create_file("sco", 0444, bt_debugfs,
                                                  NULL, &sco_debugfs_fops);
@@ -1041,6 +1048,8 @@ error:
 
 void __exit sco_exit(void)
 {
+       bt_procfs_cleanup(&init_net, "sco");
+
        debugfs_remove(sco_debugfs);
 
        if (bt_sock_unregister(BTPROTO_SCO) < 0)