Skip to content

Commit 5c69b0a

Browse files
author
Gustavo F. Padovan
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth
2 parents ce7e4ad + 33cb722 commit 5c69b0a

6 files changed

Lines changed: 24 additions & 15 deletions

File tree

‎drivers/bluetooth/Kconfig‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ config BT_MRVL
188188
The core driver to support Marvell Bluetooth devices.
189189

190190
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.
192192

193193
Say Y here to compile Marvell Bluetooth driver
194194
into the kernel or say M to compile it as module.
@@ -201,8 +201,8 @@ config BT_MRVL_SDIO
201201
The driver for Marvell Bluetooth chipsets with SDIO interface.
202202

203203
This driver is required if you want to use Marvell Bluetooth
204-
devices with SDIO interface. Currently SD8688/SD8787 chipsets are
205-
supported.
204+
devices with SDIO interface. Currently SD8688/SD8787/SD8797
205+
chipsets are supported.
206206

207207
Say Y here to compile support for Marvell BT-over-SDIO driver
208208
into the kernel or say M to compile it as module.

‎drivers/bluetooth/btmrvl_sdio.c‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static const struct btmrvl_sdio_card_reg btmrvl_reg_8688 = {
6464
.io_port_1 = 0x01,
6565
.io_port_2 = 0x02,
6666
};
67-
static const struct btmrvl_sdio_card_reg btmrvl_reg_8787 = {
67+
static const struct btmrvl_sdio_card_reg btmrvl_reg_87xx = {
6868
.cfg = 0x00,
6969
.host_int_mask = 0x02,
7070
.host_intstatus = 0x03,
@@ -91,7 +91,14 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = {
9191
static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = {
9292
.helper = NULL,
9393
.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,
95102
.sd_blksz_fw_dl = 256,
96103
};
97104

@@ -102,6 +109,9 @@ static const struct sdio_device_id btmrvl_sdio_ids[] = {
102109
/* Marvell SD8787 Bluetooth device */
103110
{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x911A),
104111
.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 },
105115

106116
{ } /* Terminating entry */
107117
};
@@ -1075,3 +1085,4 @@ MODULE_LICENSE("GPL v2");
10751085
MODULE_FIRMWARE("sd8688_helper.bin");
10761086
MODULE_FIRMWARE("sd8688.bin");
10771087
MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin");
1088+
MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin");

‎drivers/bluetooth/btusb.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,8 @@ static int btusb_send_frame(struct sk_buff *skb)
785785
usb_mark_last_busy(data->udev);
786786
}
787787

788-
usb_free_urb(urb);
789-
790788
done:
789+
usb_free_urb(urb);
791790
return err;
792791
}
793792

‎net/bluetooth/bnep/core.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,12 @@ static struct bnep_session *__bnep_get_session(u8 *dst)
7777

7878
static void __bnep_link_session(struct bnep_session *s)
7979
{
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);
8480
list_add(&s->list, &bnep_session_list);
8581
}
8682

8783
static void __bnep_unlink_session(struct bnep_session *s)
8884
{
8985
list_del(&s->list);
90-
module_put(THIS_MODULE);
9186
}
9287

9388
static int bnep_send(struct bnep_session *s, void *data, size_t len)
@@ -528,6 +523,7 @@ static int bnep_session(void *arg)
528523

529524
up_write(&bnep_session_sem);
530525
free_netdev(dev);
526+
module_put_and_exit(0);
531527
return 0;
532528
}
533529

@@ -614,9 +610,11 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
614610

615611
__bnep_link_session(s);
616612

613+
__module_get(THIS_MODULE);
617614
s->task = kthread_run(bnep_session, s, "kbnepd %s", dev->name);
618615
if (IS_ERR(s->task)) {
619616
/* Session thread start failed, gotta cleanup. */
617+
module_put(THIS_MODULE);
620618
unregister_netdev(dev);
621619
__bnep_unlink_session(s);
622620
err = PTR_ERR(s->task);

‎net/bluetooth/cmtp/core.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,12 @@ static struct cmtp_session *__cmtp_get_session(bdaddr_t *bdaddr)
6565

6666
static void __cmtp_link_session(struct cmtp_session *session)
6767
{
68-
__module_get(THIS_MODULE);
6968
list_add(&session->list, &cmtp_session_list);
7069
}
7170

7271
static void __cmtp_unlink_session(struct cmtp_session *session)
7372
{
7473
list_del(&session->list);
75-
module_put(THIS_MODULE);
7674
}
7775

7876
static void __cmtp_copy_session(struct cmtp_session *session, struct cmtp_conninfo *ci)
@@ -325,6 +323,7 @@ static int cmtp_session(void *arg)
325323
up_write(&cmtp_session_sem);
326324

327325
kfree(session);
326+
module_put_and_exit(0);
328327
return 0;
329328
}
330329

@@ -374,9 +373,11 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock)
374373

375374
__cmtp_link_session(session);
376375

376+
__module_get(THIS_MODULE);
377377
session->task = kthread_run(cmtp_session, session, "kcmtpd_ctr_%d",
378378
session->num);
379379
if (IS_ERR(session->task)) {
380+
module_put(THIS_MODULE);
380381
err = PTR_ERR(session->task);
381382
goto unlink;
382383
}

‎net/bluetooth/hci_event.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ static void hci_setup(struct hci_dev *hdev)
564564
{
565565
hci_setup_event_mask(hdev);
566566

567-
if (hdev->lmp_ver > 1)
567+
if (hdev->hci_ver > 1)
568568
hci_send_cmd(hdev, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL);
569569

570570
if (hdev->features[6] & LMP_SIMPLE_PAIR) {

0 commit comments

Comments
 (0)