summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorMarcel Holtmann2013-10-11 01:52:43 +0200
committerJohan Hedberg2013-10-11 09:45:34 +0200
commite1a26170692dc1e5fbe0ccd98ef86cc9fcd31a64 (patch)
treee0960ade9f09c39dc44c92604e7f758760ea1fce /net/bluetooth/hci_core.c
parentBluetooth: Remove unused h4_check_data_len() function (diff)
downloadkernel-qcow2-linux-e1a26170692dc1e5fbe0ccd98ef86cc9fcd31a64.tar.gz
kernel-qcow2-linux-e1a26170692dc1e5fbe0ccd98ef86cc9fcd31a64.tar.xz
kernel-qcow2-linux-e1a26170692dc1e5fbe0ccd98ef86cc9fcd31a64.zip
Bluetooth: Provide hdev parameter to hci_recv_frame() driver callback
To avoid casting skb->dev into hdev, just let the drivers provide the hdev directly when calling hci_recv_frame() function. This patch also fixes up all drivers to provide the hdev. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 6cc2f86499f8..4f0d4b443171 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2485,9 +2485,8 @@ int hci_resume_dev(struct hci_dev *hdev)
EXPORT_SYMBOL(hci_resume_dev);
/* Receive frame from HCI drivers */
-int hci_recv_frame(struct sk_buff *skb)
+int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
{
- struct hci_dev *hdev = (struct hci_dev *) skb->dev;
if (!hdev || (!test_bit(HCI_UP, &hdev->flags)
&& !test_bit(HCI_INIT, &hdev->flags))) {
kfree_skb(skb);
@@ -2546,7 +2545,6 @@ static int hci_reassembly(struct hci_dev *hdev, int type, void *data,
scb->expect = hlen;
scb->pkt_type = type;
- skb->dev = (void *) hdev;
hdev->reassembly[index] = skb;
}
@@ -2606,7 +2604,7 @@ static int hci_reassembly(struct hci_dev *hdev, int type, void *data,
/* Complete frame */
bt_cb(skb)->pkt_type = type;
- hci_recv_frame(skb);
+ hci_recv_frame(hdev, skb);
hdev->reassembly[index] = NULL;
return remain;