diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-02-07 17:08:52 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-02-14 15:27:36 -0500 |
commit | 642745184f82688eb3ef0cdfaa4ba632055be9af (patch) | |
tree | 481319e39ccd971d770d88e48507469aad4adc87 /net/bluetooth/af_bluetooth.c | |
parent | c4c896e1471aec3b004a693c689f60be3b17ac86 (diff) |
Bluetooth: Merge L2CAP and SCO modules into bluetooth.ko
Actually doesn't make sense have these modules built separately.
The L2CAP layer is needed by almost all Bluetooth protocols and profiles.
There isn't any real use case without having L2CAP loaded.
SCO is only essential for Audio transfers, but it is so small that we can
have it loaded always in bluetooth.ko without problems.
If you really doesn't want it you can disable SCO in the kernel config.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/af_bluetooth.c')
-rw-r--r-- | net/bluetooth/af_bluetooth.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 2abfe2f30453..c258027bc8fe 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
@@ -40,7 +40,7 @@ | |||
40 | 40 | ||
41 | #include <net/bluetooth/bluetooth.h> | 41 | #include <net/bluetooth/bluetooth.h> |
42 | 42 | ||
43 | #define VERSION "2.15" | 43 | #define VERSION "2.16" |
44 | 44 | ||
45 | /* Bluetooth sockets */ | 45 | /* Bluetooth sockets */ |
46 | #define BT_MAX_PROTO 8 | 46 | #define BT_MAX_PROTO 8 |
@@ -545,13 +545,41 @@ static int __init bt_init(void) | |||
545 | 545 | ||
546 | BT_INFO("HCI device and connection manager initialized"); | 546 | BT_INFO("HCI device and connection manager initialized"); |
547 | 547 | ||
548 | hci_sock_init(); | 548 | err = hci_sock_init(); |
549 | if (err < 0) | ||
550 | goto error; | ||
551 | |||
552 | err = l2cap_init(); | ||
553 | if (err < 0) { | ||
554 | hci_sock_cleanup(); | ||
555 | goto sock_err; | ||
556 | } | ||
557 | |||
558 | err = sco_init(); | ||
559 | if (err < 0) { | ||
560 | l2cap_exit(); | ||
561 | goto sock_err; | ||
562 | } | ||
549 | 563 | ||
550 | return 0; | 564 | return 0; |
565 | |||
566 | sock_err: | ||
567 | hci_sock_cleanup(); | ||
568 | |||
569 | error: | ||
570 | sock_unregister(PF_BLUETOOTH); | ||
571 | bt_sysfs_cleanup(); | ||
572 | |||
573 | return err; | ||
551 | } | 574 | } |
552 | 575 | ||
553 | static void __exit bt_exit(void) | 576 | static void __exit bt_exit(void) |
554 | { | 577 | { |
578 | |||
579 | sco_exit(); | ||
580 | |||
581 | l2cap_exit(); | ||
582 | |||
555 | hci_sock_cleanup(); | 583 | hci_sock_cleanup(); |
556 | 584 | ||
557 | sock_unregister(PF_BLUETOOTH); | 585 | sock_unregister(PF_BLUETOOTH); |