- /* Unregister socket, protocol and notifier */
- if ((err = bt_sock_unregister(BTPROTO_RFCOMM)))
- BT_ERR("RFCOMM socket layer unregistration failed. %d", err);
+ if (bt_sock_unregister(BTPROTO_RFCOMM) < 0)
+ BT_ERR("RFCOMM socket layer unregistration failed");
+
+ proto_unregister(&rfcomm_proto);