]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/net/bluetooth/rfcomm.h
Merge tags 'for-linus' and 'for-next' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / include / net / bluetooth / rfcomm.h
index 4190af53a46ad1a5f7868f4add65363e5ada9b20..da4acefe39c81abbc11af58c88eb283159d1de26 100644 (file)
@@ -21,6 +21,8 @@
    SOFTWARE IS DISCLAIMED.
 */
 
+#include <linux/refcount.h>
+
 #ifndef __RFCOMM_H
 #define __RFCOMM_H
 
@@ -174,7 +176,7 @@ struct rfcomm_dlc {
        struct mutex  lock;
        unsigned long state;
        unsigned long flags;
-       atomic_t      refcnt;
+       refcount_t    refcnt;
        u8            dlci;
        u8            addr;
        u8            priority;
@@ -247,12 +249,12 @@ struct rfcomm_dlc *rfcomm_dlc_exists(bdaddr_t *src, bdaddr_t *dst, u8 channel);
 
 static inline void rfcomm_dlc_hold(struct rfcomm_dlc *d)
 {
-       atomic_inc(&d->refcnt);
+       refcount_inc(&d->refcnt);
 }
 
 static inline void rfcomm_dlc_put(struct rfcomm_dlc *d)
 {
-       if (atomic_dec_and_test(&d->refcnt))
+       if (refcount_dec_and_test(&d->refcnt))
                rfcomm_dlc_free(d);
 }