diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 0f621d12d927..4dd08ba13aa6 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -341,7 +340,6 @@ struct adv_monitor { struct hci_dev { struct list_head list; - struct srcu_struct srcu; struct mutex lock; struct ida unset_handle_ida; diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index afdfe14eb738..fa6c00ad2dca 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -64,7 +64,7 @@ static DEFINE_IDA(hci_index_ida); /* Get HCI device by index. * Device is held on return. */ -static struct hci_dev *__hci_dev_get(int index, int *srcu_index) +struct hci_dev *hci_dev_get(int index) { struct hci_dev *hdev = NULL, *d; @@ -77,8 +77,6 @@ static struct hci_dev *__hci_dev_get(int index, int *srcu_index) list_for_each_entry(d, &hci_dev_list, list) { if (d->id == index) { hdev = hci_dev_hold(d); - if (srcu_index) - *srcu_index = srcu_read_lock(&d->srcu); break; } } @@ -86,22 +84,6 @@ static struct hci_dev *__hci_dev_get(int index, int *srcu_index) return hdev; } -struct hci_dev *hci_dev_get(int index) -{ - return __hci_dev_get(index, NULL); -} - -static struct hci_dev *hci_dev_get_srcu(int index, int *srcu_index) -{ - return __hci_dev_get(index, srcu_index); -} - -static void hci_dev_put_srcu(struct hci_dev *hdev, int srcu_index) -{ - srcu_read_unlock(&hdev->srcu, srcu_index); - hci_dev_put(hdev); -} - /* ---- Inquiry support ---- */ bool hci_discovery_active(struct hci_dev *hdev) @@ -586,9 +568,9 @@ static int hci_dev_do_reset(struct hci_dev *hdev) int hci_dev_reset(__u16 dev) { struct hci_dev *hdev; - int err, srcu_index; + int err; - hdev = hci_dev_get_srcu(dev, &srcu_index); + hdev = hci_dev_get(dev); if (!hdev) return -ENODEV; @@ -610,7 +592,7 @@ int hci_dev_reset(__u16 dev) err = hci_dev_do_reset(hdev); done: - hci_dev_put_srcu(hdev, srcu_index); + hci_dev_put(hdev); return err; } @@ -2457,11 +2439,6 @@ struct hci_dev *hci_alloc_dev_priv(int sizeof_priv) if (!hdev) return NULL; - if (init_srcu_struct(&hdev->srcu)) { - kfree(hdev); - return NULL; - } - hdev->pkt_type = (HCI_DM1 | HCI_DH1 | HCI_HV1); hdev->esco_type = (ESCO_HV1); hdev->link_mode = (HCI_LM_ACCEPT); @@ -2706,9 +2683,6 @@ void hci_unregister_dev(struct hci_dev *hdev) list_del(&hdev->list); write_unlock(&hci_dev_list_lock); - synchronize_srcu(&hdev->srcu); - cleanup_srcu_struct(&hdev->srcu); - disable_work_sync(&hdev->rx_work); disable_work_sync(&hdev->cmd_work); disable_work_sync(&hdev->tx_work);