From: John W. Linville Date: Mon, 19 Dec 2011 19:28:22 +0000 (-0500) Subject: Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/blueto... X-Git-Tag: v3.3-rc1~182^2~44^2~71 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=9662cbc712babe3f7a792af2bdd47fa0c631f27f;p=linux-2.6-block.git Merge branch 'master' of git://git./linux/kernel/git/padovan/bluetooth-next --- 9662cbc712babe3f7a792af2bdd47fa0c631f27f diff --cc include/net/bluetooth/hci_core.h index ea4395f1d260,74f8356b9ff1..25c161ab6803 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@@ -592,15 -582,15 +586,13 @@@ static inline struct hci_dev *__hci_dev return d; } -static inline struct hci_dev *hci_dev_hold(struct hci_dev *d) -{ - if (try_module_get(d->owner)) - return __hci_dev_hold(d); - return NULL; -} +#define hci_dev_hold(d) \ +({ \ + try_module_get(d->owner) ? __hci_dev_hold(d) : 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);