aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btmrvl_main.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-02-09 15:58:32 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-13 10:01:37 -0500
commit155961e8001719af6d87cbcc961111e8ce477843 (patch)
tree5b2485b5a7b2074f9e01111cf8539a34f34ce2d5 /drivers/bluetooth/btmrvl_main.c
parentaa2b86d761a95068354511de755695ef6b53afc7 (diff)
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>
Diffstat (limited to 'drivers/bluetooth/btmrvl_main.c')
-rw-r--r--drivers/bluetooth/btmrvl_main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c
index 66b58fd09fbe..d1209adc882d 100644
--- a/drivers/bluetooth/btmrvl_main.c
+++ b/drivers/bluetooth/btmrvl_main.c
@@ -394,12 +394,13 @@ static int btmrvl_send_frame(struct sk_buff *skb)
394 394
395 BT_DBG("type=%d, len=%d", skb->pkt_type, skb->len); 395 BT_DBG("type=%d, len=%d", skb->pkt_type, skb->len);
396 396
397 if (!hdev || !hdev->driver_data) { 397 if (!hdev) {
398 BT_ERR("Frame for unknown HCI device"); 398 BT_ERR("Frame for unknown HCI device");
399 return -ENODEV; 399 return -ENODEV;
400 } 400 }
401 401
402 priv = (struct btmrvl_private *) hdev->driver_data; 402 priv = hci_get_drvdata(hdev);
403
403 if (!test_bit(HCI_RUNNING, &hdev->flags)) { 404 if (!test_bit(HCI_RUNNING, &hdev->flags)) {
404 BT_ERR("Failed testing HCI_RUNING, flags=%lx", hdev->flags); 405 BT_ERR("Failed testing HCI_RUNING, flags=%lx", hdev->flags);
405 print_hex_dump_bytes("data: ", DUMP_PREFIX_OFFSET, 406 print_hex_dump_bytes("data: ", DUMP_PREFIX_OFFSET,
@@ -430,7 +431,7 @@ static int btmrvl_send_frame(struct sk_buff *skb)
430 431
431static int btmrvl_flush(struct hci_dev *hdev) 432static int btmrvl_flush(struct hci_dev *hdev)
432{ 433{
433 struct btmrvl_private *priv = hdev->driver_data; 434 struct btmrvl_private *priv = hci_get_drvdata(hdev);
434 435
435 skb_queue_purge(&priv->adapter->tx_queue); 436 skb_queue_purge(&priv->adapter->tx_queue);
436 437
@@ -439,7 +440,7 @@ static int btmrvl_flush(struct hci_dev *hdev)
439 440
440static int btmrvl_close(struct hci_dev *hdev) 441static int btmrvl_close(struct hci_dev *hdev)
441{ 442{
442 struct btmrvl_private *priv = hdev->driver_data; 443 struct btmrvl_private *priv = hci_get_drvdata(hdev);
443 444
444 if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags)) 445 if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
445 return 0; 446 return 0;
@@ -542,7 +543,7 @@ int btmrvl_register_hdev(struct btmrvl_private *priv)
542 } 543 }
543 544
544 priv->btmrvl_dev.hcidev = hdev; 545 priv->btmrvl_dev.hcidev = hdev;
545 hdev->driver_data = priv; 546 hci_set_drvdata(hdev, priv);
546 547
547 hdev->bus = HCI_SDIO; 548 hdev->bus = HCI_SDIO;
548 hdev->open = btmrvl_open; 549 hdev->open = btmrvl_open;