Skip to content

Commit 176cbec

Browse files
committed
Bluetooth: hci_core: Don't use hci_prepare_cmd
This replaces the instance of hci_prepare_cmd with hci_cmd_sync_alloc since the former is part of hci_request.c which is considered deprecated. Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 92048ab commit 176cbec

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

include/net/bluetooth/hci_sync.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ struct hci_cmd_sync_work_entry {
2020
};
2121

2222
struct adv_info;
23+
24+
struct sk_buff *hci_cmd_sync_alloc(struct hci_dev *hdev, u16 opcode, u32 plen,
25+
const void *param, struct sock *sk);
26+
2327
/* Function with sync suffix shall not be called with hdev->lock held as they
2428
* wait the command to complete and in the meantime an event could be received
2529
* which could attempt to acquire hdev->lock causing a deadlock.

net/bluetooth/hci_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3054,7 +3054,7 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen,
30543054

30553055
BT_DBG("%s opcode 0x%4.4x plen %d", hdev->name, opcode, plen);
30563056

3057-
skb = hci_prepare_cmd(hdev, opcode, plen, param);
3057+
skb = hci_cmd_sync_alloc(hdev, opcode, plen, param, NULL);
30583058
if (!skb) {
30593059
bt_dev_err(hdev, "no memory for command");
30603060
return -ENOMEM;
@@ -3089,7 +3089,7 @@ int __hci_cmd_send(struct hci_dev *hdev, u16 opcode, u32 plen,
30893089
return -EINVAL;
30903090
}
30913091

3092-
skb = hci_prepare_cmd(hdev, opcode, plen, param);
3092+
skb = hci_cmd_sync_alloc(hdev, opcode, plen, param, NULL);
30933093
if (!skb) {
30943094
bt_dev_err(hdev, "no memory for command (opcode 0x%4.4x)",
30953095
opcode);

net/bluetooth/hci_sync.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ static void hci_cmd_sync_complete(struct hci_dev *hdev, u8 result, u16 opcode,
4949
wake_up_interruptible(&hdev->req_wait_q);
5050
}
5151

52-
static struct sk_buff *hci_cmd_sync_alloc(struct hci_dev *hdev, u16 opcode,
53-
u32 plen, const void *param,
54-
struct sock *sk)
52+
struct sk_buff *hci_cmd_sync_alloc(struct hci_dev *hdev, u16 opcode, u32 plen,
53+
const void *param, struct sock *sk)
5554
{
5655
int len = HCI_COMMAND_HDR_SIZE + plen;
5756
struct hci_command_hdr *hdr;

0 commit comments

Comments
 (0)