diff options
-rw-r--r-- | drivers/bluetooth/Kconfig | 6 | ||||
-rw-r--r-- | drivers/bluetooth/btmrvl_sdio.c | 15 | ||||
-rw-r--r-- | drivers/bluetooth/btusb.c | 3 | ||||
-rw-r--r-- | net/bluetooth/bnep/core.c | 8 | ||||
-rw-r--r-- | net/bluetooth/cmtp/core.c | 5 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 2 |
6 files changed, 24 insertions, 15 deletions
diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index 11b41fd40c27..5ccf142ef0b8 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig | |||
@@ -188,7 +188,7 @@ config BT_MRVL | |||
188 | The core driver to support Marvell Bluetooth devices. | 188 | The core driver to support Marvell Bluetooth devices. |
189 | 189 | ||
190 | This driver is required if you want to support | 190 | This driver is required if you want to support |
191 | Marvell Bluetooth devices, such as 8688/8787. | 191 | Marvell Bluetooth devices, such as 8688/8787/8797. |
192 | 192 | ||
193 | Say Y here to compile Marvell Bluetooth driver | 193 | Say Y here to compile Marvell Bluetooth driver |
194 | into the kernel or say M to compile it as module. | 194 | into the kernel or say M to compile it as module. |
@@ -201,8 +201,8 @@ config BT_MRVL_SDIO | |||
201 | The driver for Marvell Bluetooth chipsets with SDIO interface. | 201 | The driver for Marvell Bluetooth chipsets with SDIO interface. |
202 | 202 | ||
203 | This driver is required if you want to use Marvell Bluetooth | 203 | This driver is required if you want to use Marvell Bluetooth |
204 | devices with SDIO interface. Currently SD8688/SD8787 chipsets are | 204 | devices with SDIO interface. Currently SD8688/SD8787/SD8797 |
205 | supported. | 205 | chipsets are supported. |
206 | 206 | ||
207 | Say Y here to compile support for Marvell BT-over-SDIO driver | 207 | Say Y here to compile support for Marvell BT-over-SDIO driver |
208 | into the kernel or say M to compile it as module. | 208 | into the kernel or say M to compile it as module. |
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c index c827d737ccee..37b56398c8a6 100644 --- a/drivers/bluetooth/btmrvl_sdio.c +++ b/drivers/bluetooth/btmrvl_sdio.c | |||
@@ -64,7 +64,7 @@ static const struct btmrvl_sdio_card_reg btmrvl_reg_8688 = { | |||
64 | .io_port_1 = 0x01, | 64 | .io_port_1 = 0x01, |
65 | .io_port_2 = 0x02, | 65 | .io_port_2 = 0x02, |
66 | }; | 66 | }; |
67 | static const struct btmrvl_sdio_card_reg btmrvl_reg_8787 = { | 67 | static const struct btmrvl_sdio_card_reg btmrvl_reg_87xx = { |
68 | .cfg = 0x00, | 68 | .cfg = 0x00, |
69 | .host_int_mask = 0x02, | 69 | .host_int_mask = 0x02, |
70 | .host_intstatus = 0x03, | 70 | .host_intstatus = 0x03, |
@@ -91,7 +91,14 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = { | |||
91 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = { | 91 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = { |
92 | .helper = NULL, | 92 | .helper = NULL, |
93 | .firmware = "mrvl/sd8787_uapsta.bin", | 93 | .firmware = "mrvl/sd8787_uapsta.bin", |
94 | .reg = &btmrvl_reg_8787, | 94 | .reg = &btmrvl_reg_87xx, |
95 | .sd_blksz_fw_dl = 256, | ||
96 | }; | ||
97 | |||
98 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8797 = { | ||
99 | .helper = NULL, | ||
100 | .firmware = "mrvl/sd8797_uapsta.bin", | ||
101 | .reg = &btmrvl_reg_87xx, | ||
95 | .sd_blksz_fw_dl = 256, | 102 | .sd_blksz_fw_dl = 256, |
96 | }; | 103 | }; |
97 | 104 | ||
@@ -102,6 +109,9 @@ static const struct sdio_device_id btmrvl_sdio_ids[] = { | |||
102 | /* Marvell SD8787 Bluetooth device */ | 109 | /* Marvell SD8787 Bluetooth device */ |
103 | { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x911A), | 110 | { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x911A), |
104 | .driver_data = (unsigned long) &btmrvl_sdio_sd8787 }, | 111 | .driver_data = (unsigned long) &btmrvl_sdio_sd8787 }, |
112 | /* Marvell SD8797 Bluetooth device */ | ||
113 | { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x912A), | ||
114 | .driver_data = (unsigned long) &btmrvl_sdio_sd8797 }, | ||
105 | 115 | ||
106 | { } /* Terminating entry */ | 116 | { } /* Terminating entry */ |
107 | }; | 117 | }; |
@@ -1075,3 +1085,4 @@ MODULE_LICENSE("GPL v2"); | |||
1075 | MODULE_FIRMWARE("sd8688_helper.bin"); | 1085 | MODULE_FIRMWARE("sd8688_helper.bin"); |
1076 | MODULE_FIRMWARE("sd8688.bin"); | 1086 | MODULE_FIRMWARE("sd8688.bin"); |
1077 | MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin"); | 1087 | MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin"); |
1088 | MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin"); | ||
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 2bd87d45f1c2..ea5ad1cbbd3d 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -785,9 +785,8 @@ skip_waking: | |||
785 | usb_mark_last_busy(data->udev); | 785 | usb_mark_last_busy(data->udev); |
786 | } | 786 | } |
787 | 787 | ||
788 | usb_free_urb(urb); | ||
789 | |||
790 | done: | 788 | done: |
789 | usb_free_urb(urb); | ||
791 | return err; | 790 | return err; |
792 | } | 791 | } |
793 | 792 | ||
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index a6cd856046ab..42d53b85a808 100644 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c | |||
@@ -77,17 +77,12 @@ static struct bnep_session *__bnep_get_session(u8 *dst) | |||
77 | 77 | ||
78 | static void __bnep_link_session(struct bnep_session *s) | 78 | static void __bnep_link_session(struct bnep_session *s) |
79 | { | 79 | { |
80 | /* It's safe to call __module_get() here because sessions are added | ||
81 | by the socket layer which has to hold the reference to this module. | ||
82 | */ | ||
83 | __module_get(THIS_MODULE); | ||
84 | list_add(&s->list, &bnep_session_list); | 80 | list_add(&s->list, &bnep_session_list); |
85 | } | 81 | } |
86 | 82 | ||
87 | static void __bnep_unlink_session(struct bnep_session *s) | 83 | static void __bnep_unlink_session(struct bnep_session *s) |
88 | { | 84 | { |
89 | list_del(&s->list); | 85 | list_del(&s->list); |
90 | module_put(THIS_MODULE); | ||
91 | } | 86 | } |
92 | 87 | ||
93 | static int bnep_send(struct bnep_session *s, void *data, size_t len) | 88 | static int bnep_send(struct bnep_session *s, void *data, size_t len) |
@@ -528,6 +523,7 @@ static int bnep_session(void *arg) | |||
528 | 523 | ||
529 | up_write(&bnep_session_sem); | 524 | up_write(&bnep_session_sem); |
530 | free_netdev(dev); | 525 | free_netdev(dev); |
526 | module_put_and_exit(0); | ||
531 | return 0; | 527 | return 0; |
532 | } | 528 | } |
533 | 529 | ||
@@ -614,9 +610,11 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock) | |||
614 | 610 | ||
615 | __bnep_link_session(s); | 611 | __bnep_link_session(s); |
616 | 612 | ||
613 | __module_get(THIS_MODULE); | ||
617 | s->task = kthread_run(bnep_session, s, "kbnepd %s", dev->name); | 614 | s->task = kthread_run(bnep_session, s, "kbnepd %s", dev->name); |
618 | if (IS_ERR(s->task)) { | 615 | if (IS_ERR(s->task)) { |
619 | /* Session thread start failed, gotta cleanup. */ | 616 | /* Session thread start failed, gotta cleanup. */ |
617 | module_put(THIS_MODULE); | ||
620 | unregister_netdev(dev); | 618 | unregister_netdev(dev); |
621 | __bnep_unlink_session(s); | 619 | __bnep_unlink_session(s); |
622 | err = PTR_ERR(s->task); | 620 | err = PTR_ERR(s->task); |
diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c index 9e8940b24bba..6c9c1fd601ca 100644 --- a/net/bluetooth/cmtp/core.c +++ b/net/bluetooth/cmtp/core.c | |||
@@ -65,14 +65,12 @@ static struct cmtp_session *__cmtp_get_session(bdaddr_t *bdaddr) | |||
65 | 65 | ||
66 | static void __cmtp_link_session(struct cmtp_session *session) | 66 | static void __cmtp_link_session(struct cmtp_session *session) |
67 | { | 67 | { |
68 | __module_get(THIS_MODULE); | ||
69 | list_add(&session->list, &cmtp_session_list); | 68 | list_add(&session->list, &cmtp_session_list); |
70 | } | 69 | } |
71 | 70 | ||
72 | static void __cmtp_unlink_session(struct cmtp_session *session) | 71 | static void __cmtp_unlink_session(struct cmtp_session *session) |
73 | { | 72 | { |
74 | list_del(&session->list); | 73 | list_del(&session->list); |
75 | module_put(THIS_MODULE); | ||
76 | } | 74 | } |
77 | 75 | ||
78 | static void __cmtp_copy_session(struct cmtp_session *session, struct cmtp_conninfo *ci) | 76 | static void __cmtp_copy_session(struct cmtp_session *session, struct cmtp_conninfo *ci) |
@@ -325,6 +323,7 @@ static int cmtp_session(void *arg) | |||
325 | up_write(&cmtp_session_sem); | 323 | up_write(&cmtp_session_sem); |
326 | 324 | ||
327 | kfree(session); | 325 | kfree(session); |
326 | module_put_and_exit(0); | ||
328 | return 0; | 327 | return 0; |
329 | } | 328 | } |
330 | 329 | ||
@@ -374,9 +373,11 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock) | |||
374 | 373 | ||
375 | __cmtp_link_session(session); | 374 | __cmtp_link_session(session); |
376 | 375 | ||
376 | __module_get(THIS_MODULE); | ||
377 | session->task = kthread_run(cmtp_session, session, "kcmtpd_ctr_%d", | 377 | session->task = kthread_run(cmtp_session, session, "kcmtpd_ctr_%d", |
378 | session->num); | 378 | session->num); |
379 | if (IS_ERR(session->task)) { | 379 | if (IS_ERR(session->task)) { |
380 | module_put(THIS_MODULE); | ||
380 | err = PTR_ERR(session->task); | 381 | err = PTR_ERR(session->task); |
381 | goto unlink; | 382 | goto unlink; |
382 | } | 383 | } |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 4f35ecdc6c62..e3f7a8192446 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -564,7 +564,7 @@ static void hci_setup(struct hci_dev *hdev) | |||
564 | { | 564 | { |
565 | hci_setup_event_mask(hdev); | 565 | hci_setup_event_mask(hdev); |
566 | 566 | ||
567 | if (hdev->lmp_ver > 1) | 567 | if (hdev->hci_ver > 1) |
568 | hci_send_cmd(hdev, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL); | 568 | hci_send_cmd(hdev, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL); |
569 | 569 | ||
570 | if (hdev->features[6] & LMP_SIMPLE_PAIR) { | 570 | if (hdev->features[6] & LMP_SIMPLE_PAIR) { |