From: Stephen Rothwell Date: Mon, 19 Dec 2011 02:48:52 +0000 (+1100) Subject: Merge remote-tracking branch 'bluetooth/master' X-Git-Tag: next-20111219~58 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=342c71f64b076bbe879b9ecd477bc793ec563d4a;p=karo-tx-linux.git Merge remote-tracking branch 'bluetooth/master' --- 342c71f64b076bbe879b9ecd477bc793ec563d4a diff --cc include/net/bluetooth/hci_core.h index ea4395f1d260,105eaa251034..a449fc6d4449 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@@ -592,15 -577,15 +581,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);