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>
This commit is contained in:
@@ -117,7 +117,7 @@ struct adv_entry {
|
||||
#define NUM_REASSEMBLY 4
|
||||
struct hci_dev {
|
||||
struct list_head list;
|
||||
spinlock_t lock;
|
||||
struct mutex lock;
|
||||
atomic_t refcnt;
|
||||
|
||||
char name[8];
|
||||
@@ -566,10 +566,8 @@ static inline struct hci_dev *hci_dev_hold(struct hci_dev *d)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define hci_dev_lock(d) spin_lock(&d->lock)
|
||||
#define hci_dev_unlock(d) spin_unlock(&d->lock)
|
||||
#define hci_dev_lock_bh(d) spin_lock_bh(&d->lock)
|
||||
#define hci_dev_unlock_bh(d) spin_unlock_bh(&d->lock)
|
||||
#define hci_dev_lock(d) mutex_lock(&d->lock)
|
||||
#define hci_dev_unlock(d) mutex_unlock(&d->lock)
|
||||
|
||||
struct hci_dev *hci_dev_get(int index);
|
||||
struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst);
|
||||
|
Reference in New Issue
Block a user