Bluetooth: Remove hci_dev->driver_data
The linux device model provides dev_set/get_drvdata so we can use this to save private driver data. This also removes several unnecessary casts. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:

committed by
Johan Hedberg

parent
aa2b86d761
commit
155961e800
@@ -411,7 +411,7 @@ unlock:
|
||||
|
||||
static int bfusb_open(struct hci_dev *hdev)
|
||||
{
|
||||
struct bfusb_data *data = hdev->driver_data;
|
||||
struct bfusb_data *data = hci_get_drvdata(hdev);
|
||||
unsigned long flags;
|
||||
int i, err;
|
||||
|
||||
@@ -437,7 +437,7 @@ static int bfusb_open(struct hci_dev *hdev)
|
||||
|
||||
static int bfusb_flush(struct hci_dev *hdev)
|
||||
{
|
||||
struct bfusb_data *data = hdev->driver_data;
|
||||
struct bfusb_data *data = hci_get_drvdata(hdev);
|
||||
|
||||
BT_DBG("hdev %p bfusb %p", hdev, data);
|
||||
|
||||
@@ -448,7 +448,7 @@ static int bfusb_flush(struct hci_dev *hdev)
|
||||
|
||||
static int bfusb_close(struct hci_dev *hdev)
|
||||
{
|
||||
struct bfusb_data *data = hdev->driver_data;
|
||||
struct bfusb_data *data = hci_get_drvdata(hdev);
|
||||
unsigned long flags;
|
||||
|
||||
BT_DBG("hdev %p bfusb %p", hdev, data);
|
||||
@@ -483,7 +483,7 @@ static int bfusb_send_frame(struct sk_buff *skb)
|
||||
if (!test_bit(HCI_RUNNING, &hdev->flags))
|
||||
return -EBUSY;
|
||||
|
||||
data = hdev->driver_data;
|
||||
data = hci_get_drvdata(hdev);
|
||||
|
||||
switch (bt_cb(skb)->pkt_type) {
|
||||
case HCI_COMMAND_PKT:
|
||||
@@ -696,7 +696,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
|
||||
data->hdev = hdev;
|
||||
|
||||
hdev->bus = HCI_USB;
|
||||
hdev->driver_data = data;
|
||||
hci_set_drvdata(hdev, data);
|
||||
SET_HCIDEV_DEV(hdev, &intf->dev);
|
||||
|
||||
hdev->open = bfusb_open;
|
||||
|
Reference in New Issue
Block a user