diff options
author | Masatake YAMATO <yamato@redhat.com> | 2012-07-25 12:29:49 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-08-06 14:03:00 -0400 |
commit | c6f5df16a2710e64090078dfbaa86c54a27c0874 (patch) | |
tree | 81d6b74a57978e451ae58fd99aeefbb72234b309 /net/bluetooth | |
parent | 5b28d95c13e876037d2c692e61862bb3e98249af (diff) |
Bluetooth: Added /proc/net/rfcomm via bt_procfs_init()
Added /proc/net/rfcomm via bt_procfs_init().
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/rfcomm/sock.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index 7e1e59645c05..260821a2d6e7 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -1033,8 +1033,17 @@ int __init rfcomm_init_sockets(void) | |||
1033 | return err; | 1033 | return err; |
1034 | 1034 | ||
1035 | err = bt_sock_register(BTPROTO_RFCOMM, &rfcomm_sock_family_ops); | 1035 | err = bt_sock_register(BTPROTO_RFCOMM, &rfcomm_sock_family_ops); |
1036 | if (err < 0) | 1036 | if (err < 0) { |
1037 | BT_ERR("RFCOMM socket layer registration failed"); | ||
1038 | goto error; | ||
1039 | } | ||
1040 | |||
1041 | err = bt_procfs_init(THIS_MODULE, &init_net, "rfcomm", &rfcomm_sk_list, NULL); | ||
1042 | if (err < 0) { | ||
1043 | BT_ERR("Failed to create RFCOMM proc file"); | ||
1044 | bt_sock_unregister(BTPROTO_RFCOMM); | ||
1037 | goto error; | 1045 | goto error; |
1046 | } | ||
1038 | 1047 | ||
1039 | if (bt_debugfs) { | 1048 | if (bt_debugfs) { |
1040 | rfcomm_sock_debugfs = debugfs_create_file("rfcomm", 0444, | 1049 | rfcomm_sock_debugfs = debugfs_create_file("rfcomm", 0444, |
@@ -1048,13 +1057,14 @@ int __init rfcomm_init_sockets(void) | |||
1048 | return 0; | 1057 | return 0; |
1049 | 1058 | ||
1050 | error: | 1059 | error: |
1051 | BT_ERR("RFCOMM socket layer registration failed"); | ||
1052 | proto_unregister(&rfcomm_proto); | 1060 | proto_unregister(&rfcomm_proto); |
1053 | return err; | 1061 | return err; |
1054 | } | 1062 | } |
1055 | 1063 | ||
1056 | void __exit rfcomm_cleanup_sockets(void) | 1064 | void __exit rfcomm_cleanup_sockets(void) |
1057 | { | 1065 | { |
1066 | bt_procfs_cleanup(&init_net, "rfcomm"); | ||
1067 | |||
1058 | debugfs_remove(rfcomm_sock_debugfs); | 1068 | debugfs_remove(rfcomm_sock_debugfs); |
1059 | 1069 | ||
1060 | if (bt_sock_unregister(BTPROTO_RFCOMM) < 0) | 1070 | if (bt_sock_unregister(BTPROTO_RFCOMM) < 0) |