aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/csr1212.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/csr1212.h')
-rw-r--r--drivers/ieee1394/csr1212.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/ieee1394/csr1212.h b/drivers/ieee1394/csr1212.h
index df909ce66304..043039fc63ec 100644
--- a/drivers/ieee1394/csr1212.h
+++ b/drivers/ieee1394/csr1212.h
@@ -32,6 +32,7 @@
32 32
33#include <linux/types.h> 33#include <linux/types.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <asm/atomic.h>
35 36
36#define CSR1212_MALLOC(size) kmalloc((size), GFP_KERNEL) 37#define CSR1212_MALLOC(size) kmalloc((size), GFP_KERNEL)
37#define CSR1212_FREE(ptr) kfree(ptr) 38#define CSR1212_FREE(ptr) kfree(ptr)
@@ -149,7 +150,7 @@ struct csr1212_keyval {
149 struct csr1212_directory directory; 150 struct csr1212_directory directory;
150 } value; 151 } value;
151 struct csr1212_keyval *associate; 152 struct csr1212_keyval *associate;
152 int refcnt; 153 atomic_t refcnt;
153 154
154 /* used in generating and/or parsing CSR image */ 155 /* used in generating and/or parsing CSR image */
155 struct csr1212_keyval *next, *prev; /* flat list of CSR elements */ 156 struct csr1212_keyval *next, *prev; /* flat list of CSR elements */
@@ -350,7 +351,8 @@ csr1212_get_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv);
350 * need for code to retain a keyval that has been parsed. */ 351 * need for code to retain a keyval that has been parsed. */
351static inline void csr1212_keep_keyval(struct csr1212_keyval *kv) 352static inline void csr1212_keep_keyval(struct csr1212_keyval *kv)
352{ 353{
353 kv->refcnt++; 354 atomic_inc(&kv->refcnt);
355 smp_mb__after_atomic_inc();
354} 356}
355 357
356 358