aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-10-25 18:29:22 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2015-10-26 02:21:47 -0400
commit05fcd4c4f1011858fe86dd7423304d8cae8e8d2e (patch)
treed45bcab10c146a47ba7cbba2daa74582053cc412
parent242c0ebd3730334c43b9c04eeec40d8dd5c3a26e (diff)
Bluetooth: Replace hci_notify with hci_sock_dev_event
There is no point in wrapping hci_sock_dev_event around hci_notify. It is an empty wrapper which adds no value. So remove it. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--net/bluetooth/hci_core.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 3604e0194f87..83a6aacfab31 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -65,13 +65,6 @@ static DEFINE_IDA(hci_index_ida);
65#define hci_req_lock(d) mutex_lock(&d->req_lock) 65#define hci_req_lock(d) mutex_lock(&d->req_lock)
66#define hci_req_unlock(d) mutex_unlock(&d->req_lock) 66#define hci_req_unlock(d) mutex_unlock(&d->req_lock)
67 67
68/* ---- HCI notifications ---- */
69
70static void hci_notify(struct hci_dev *hdev, int event)
71{
72 hci_sock_dev_event(hdev, event);
73}
74
75/* ---- HCI debugfs entries ---- */ 68/* ---- HCI debugfs entries ---- */
76 69
77static ssize_t dut_mode_read(struct file *file, char __user *user_buf, 70static ssize_t dut_mode_read(struct file *file, char __user *user_buf,
@@ -1455,7 +1448,7 @@ static int hci_dev_do_open(struct hci_dev *hdev)
1455 } 1448 }
1456 1449
1457 set_bit(HCI_RUNNING, &hdev->flags); 1450 set_bit(HCI_RUNNING, &hdev->flags);
1458 hci_notify(hdev, HCI_DEV_OPEN); 1451 hci_sock_dev_event(hdev, HCI_DEV_OPEN);
1459 1452
1460 atomic_set(&hdev->cmd_cnt, 1); 1453 atomic_set(&hdev->cmd_cnt, 1);
1461 set_bit(HCI_INIT, &hdev->flags); 1454 set_bit(HCI_INIT, &hdev->flags);
@@ -1524,7 +1517,7 @@ static int hci_dev_do_open(struct hci_dev *hdev)
1524 hci_dev_hold(hdev); 1517 hci_dev_hold(hdev);
1525 hci_dev_set_flag(hdev, HCI_RPA_EXPIRED); 1518 hci_dev_set_flag(hdev, HCI_RPA_EXPIRED);
1526 set_bit(HCI_UP, &hdev->flags); 1519 set_bit(HCI_UP, &hdev->flags);
1527 hci_notify(hdev, HCI_DEV_UP); 1520 hci_sock_dev_event(hdev, HCI_DEV_UP);
1528 if (!hci_dev_test_flag(hdev, HCI_SETUP) && 1521 if (!hci_dev_test_flag(hdev, HCI_SETUP) &&
1529 !hci_dev_test_flag(hdev, HCI_CONFIG) && 1522 !hci_dev_test_flag(hdev, HCI_CONFIG) &&
1530 !hci_dev_test_flag(hdev, HCI_UNCONFIGURED) && 1523 !hci_dev_test_flag(hdev, HCI_UNCONFIGURED) &&
@@ -1552,7 +1545,7 @@ static int hci_dev_do_open(struct hci_dev *hdev)
1552 } 1545 }
1553 1546
1554 clear_bit(HCI_RUNNING, &hdev->flags); 1547 clear_bit(HCI_RUNNING, &hdev->flags);
1555 hci_notify(hdev, HCI_DEV_CLOSE); 1548 hci_sock_dev_event(hdev, HCI_DEV_CLOSE);
1556 1549
1557 hdev->close(hdev); 1550 hdev->close(hdev);
1558 hdev->flags &= BIT(HCI_RAW); 1551 hdev->flags &= BIT(HCI_RAW);
@@ -1708,7 +1701,7 @@ int hci_dev_do_close(struct hci_dev *hdev)
1708 1701
1709 smp_unregister(hdev); 1702 smp_unregister(hdev);
1710 1703
1711 hci_notify(hdev, HCI_DEV_DOWN); 1704 hci_sock_dev_event(hdev, HCI_DEV_DOWN);
1712 1705
1713 if (hdev->flush) 1706 if (hdev->flush)
1714 hdev->flush(hdev); 1707 hdev->flush(hdev);
@@ -1739,7 +1732,7 @@ int hci_dev_do_close(struct hci_dev *hdev)
1739 } 1732 }
1740 1733
1741 clear_bit(HCI_RUNNING, &hdev->flags); 1734 clear_bit(HCI_RUNNING, &hdev->flags);
1742 hci_notify(hdev, HCI_DEV_CLOSE); 1735 hci_sock_dev_event(hdev, HCI_DEV_CLOSE);
1743 1736
1744 /* After this point our queues are empty 1737 /* After this point our queues are empty
1745 * and no tasks are scheduled. */ 1738 * and no tasks are scheduled. */
@@ -3414,7 +3407,7 @@ int hci_register_dev(struct hci_dev *hdev)
3414 if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) 3407 if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks))
3415 hci_dev_set_flag(hdev, HCI_UNCONFIGURED); 3408 hci_dev_set_flag(hdev, HCI_UNCONFIGURED);
3416 3409
3417 hci_notify(hdev, HCI_DEV_REG); 3410 hci_sock_dev_event(hdev, HCI_DEV_REG);
3418 hci_dev_hold(hdev); 3411 hci_dev_hold(hdev);
3419 3412
3420 queue_work(hdev->req_workqueue, &hdev->power_on); 3413 queue_work(hdev->req_workqueue, &hdev->power_on);
@@ -3462,7 +3455,7 @@ void hci_unregister_dev(struct hci_dev *hdev)
3462 * pending list */ 3455 * pending list */
3463 BUG_ON(!list_empty(&hdev->mgmt_pending)); 3456 BUG_ON(!list_empty(&hdev->mgmt_pending));
3464 3457
3465 hci_notify(hdev, HCI_DEV_UNREG); 3458 hci_sock_dev_event(hdev, HCI_DEV_UNREG);
3466 3459
3467 if (hdev->rfkill) { 3460 if (hdev->rfkill) {
3468 rfkill_unregister(hdev->rfkill); 3461 rfkill_unregister(hdev->rfkill);
@@ -3499,7 +3492,7 @@ EXPORT_SYMBOL(hci_unregister_dev);
3499/* Suspend HCI device */ 3492/* Suspend HCI device */
3500int hci_suspend_dev(struct hci_dev *hdev) 3493int hci_suspend_dev(struct hci_dev *hdev)
3501{ 3494{
3502 hci_notify(hdev, HCI_DEV_SUSPEND); 3495 hci_sock_dev_event(hdev, HCI_DEV_SUSPEND);
3503 return 0; 3496 return 0;
3504} 3497}
3505EXPORT_SYMBOL(hci_suspend_dev); 3498EXPORT_SYMBOL(hci_suspend_dev);
@@ -3507,7 +3500,7 @@ EXPORT_SYMBOL(hci_suspend_dev);
3507/* Resume HCI device */ 3500/* Resume HCI device */
3508int hci_resume_dev(struct hci_dev *hdev) 3501int hci_resume_dev(struct hci_dev *hdev)
3509{ 3502{
3510 hci_notify(hdev, HCI_DEV_RESUME); 3503 hci_sock_dev_event(hdev, HCI_DEV_RESUME);
3511 return 0; 3504 return 0;
3512} 3505}
3513EXPORT_SYMBOL(hci_resume_dev); 3506EXPORT_SYMBOL(hci_resume_dev);