Skip to content

Commit

Permalink
Bluetooth: Replace hci_notify with hci_sock_dev_event
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcel Holtmann authored and Johan Hedberg committed Oct 26, 2015
1 parent 242c0eb commit 05fcd4c
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ static DEFINE_IDA(hci_index_ida);
#define hci_req_lock(d) mutex_lock(&d->req_lock)
#define hci_req_unlock(d) mutex_unlock(&d->req_lock)

/* ---- HCI notifications ---- */

static void hci_notify(struct hci_dev *hdev, int event)
{
hci_sock_dev_event(hdev, event);
}

/* ---- HCI debugfs entries ---- */

static ssize_t dut_mode_read(struct file *file, char __user *user_buf,
Expand Down Expand Up @@ -1455,7 +1448,7 @@ static int hci_dev_do_open(struct hci_dev *hdev)
}

set_bit(HCI_RUNNING, &hdev->flags);
hci_notify(hdev, HCI_DEV_OPEN);
hci_sock_dev_event(hdev, HCI_DEV_OPEN);

atomic_set(&hdev->cmd_cnt, 1);
set_bit(HCI_INIT, &hdev->flags);
Expand Down Expand Up @@ -1524,7 +1517,7 @@ static int hci_dev_do_open(struct hci_dev *hdev)
hci_dev_hold(hdev);
hci_dev_set_flag(hdev, HCI_RPA_EXPIRED);
set_bit(HCI_UP, &hdev->flags);
hci_notify(hdev, HCI_DEV_UP);
hci_sock_dev_event(hdev, HCI_DEV_UP);
if (!hci_dev_test_flag(hdev, HCI_SETUP) &&
!hci_dev_test_flag(hdev, HCI_CONFIG) &&
!hci_dev_test_flag(hdev, HCI_UNCONFIGURED) &&
Expand Down Expand Up @@ -1552,7 +1545,7 @@ static int hci_dev_do_open(struct hci_dev *hdev)
}

clear_bit(HCI_RUNNING, &hdev->flags);
hci_notify(hdev, HCI_DEV_CLOSE);
hci_sock_dev_event(hdev, HCI_DEV_CLOSE);

hdev->close(hdev);
hdev->flags &= BIT(HCI_RAW);
Expand Down Expand Up @@ -1708,7 +1701,7 @@ int hci_dev_do_close(struct hci_dev *hdev)

smp_unregister(hdev);

hci_notify(hdev, HCI_DEV_DOWN);
hci_sock_dev_event(hdev, HCI_DEV_DOWN);

if (hdev->flush)
hdev->flush(hdev);
Expand Down Expand Up @@ -1739,7 +1732,7 @@ int hci_dev_do_close(struct hci_dev *hdev)
}

clear_bit(HCI_RUNNING, &hdev->flags);
hci_notify(hdev, HCI_DEV_CLOSE);
hci_sock_dev_event(hdev, HCI_DEV_CLOSE);

/* After this point our queues are empty
* and no tasks are scheduled. */
Expand Down Expand Up @@ -3414,7 +3407,7 @@ int hci_register_dev(struct hci_dev *hdev)
if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks))
hci_dev_set_flag(hdev, HCI_UNCONFIGURED);

hci_notify(hdev, HCI_DEV_REG);
hci_sock_dev_event(hdev, HCI_DEV_REG);
hci_dev_hold(hdev);

queue_work(hdev->req_workqueue, &hdev->power_on);
Expand Down Expand Up @@ -3462,7 +3455,7 @@ void hci_unregister_dev(struct hci_dev *hdev)
* pending list */
BUG_ON(!list_empty(&hdev->mgmt_pending));

hci_notify(hdev, HCI_DEV_UNREG);
hci_sock_dev_event(hdev, HCI_DEV_UNREG);

if (hdev->rfkill) {
rfkill_unregister(hdev->rfkill);
Expand Down Expand Up @@ -3499,15 +3492,15 @@ EXPORT_SYMBOL(hci_unregister_dev);
/* Suspend HCI device */
int hci_suspend_dev(struct hci_dev *hdev)
{
hci_notify(hdev, HCI_DEV_SUSPEND);
hci_sock_dev_event(hdev, HCI_DEV_SUSPEND);
return 0;
}
EXPORT_SYMBOL(hci_suspend_dev);

/* Resume HCI device */
int hci_resume_dev(struct hci_dev *hdev)
{
hci_notify(hdev, HCI_DEV_RESUME);
hci_sock_dev_event(hdev, HCI_DEV_RESUME);
return 0;
}
EXPORT_SYMBOL(hci_resume_dev);
Expand Down

0 comments on commit 05fcd4c

Please sign in to comment.