diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-06-17 12:03:21 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-18 14:07:54 -0500 |
commit | 09fd0de5bd8f8ef3317e5365f92f1a13dcd89aa9 (patch) | |
tree | e29f1e4fc4555eefb5a39dfd1e230afcf28da999 /include/net | |
parent | b78752cc71d86998d3b77d873c61d6ffdb7a2142 (diff) |
Bluetooth: Replace spin_lock by mutex in hci_dev
Now we run everything in HCI in process context, so it's a better idea use
mutex instead spin_lock. The macro remains hci_dev_lock() (and I got rid
of hci_dev_lock_bh()), of course.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/bluetooth/hci_core.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 1e28be45c4f2..e7dbe597a4bb 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -117,7 +117,7 @@ struct adv_entry { | |||
117 | #define NUM_REASSEMBLY 4 | 117 | #define NUM_REASSEMBLY 4 |
118 | struct hci_dev { | 118 | struct hci_dev { |
119 | struct list_head list; | 119 | struct list_head list; |
120 | spinlock_t lock; | 120 | struct mutex lock; |
121 | atomic_t refcnt; | 121 | atomic_t refcnt; |
122 | 122 | ||
123 | char name[8]; | 123 | char name[8]; |
@@ -566,10 +566,8 @@ static inline struct hci_dev *hci_dev_hold(struct hci_dev *d) | |||
566 | return NULL; | 566 | return NULL; |
567 | } | 567 | } |
568 | 568 | ||
569 | #define hci_dev_lock(d) spin_lock(&d->lock) | 569 | #define hci_dev_lock(d) mutex_lock(&d->lock) |
570 | #define hci_dev_unlock(d) spin_unlock(&d->lock) | 570 | #define hci_dev_unlock(d) mutex_unlock(&d->lock) |
571 | #define hci_dev_lock_bh(d) spin_lock_bh(&d->lock) | ||
572 | #define hci_dev_unlock_bh(d) spin_unlock_bh(&d->lock) | ||
573 | 571 | ||
574 | struct hci_dev *hci_dev_get(int index); | 572 | struct hci_dev *hci_dev_get(int index); |
575 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); | 573 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); |