diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-19 20:37:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-19 20:37:48 -0400 |
commit | 44bb4ac4bf6b3ac751dadce46367a05ff965376e (patch) | |
tree | 8737625d09cd49b660c4d6f7570ba811a9108ec0 | |
parent | e74927deee8094e81fc097ba8b73d708eae7ed44 (diff) |
staging: csr: oska: remove refcount.c
It's not called by anyone, so remove it and the .h file and don't export
the functions as they are not around anymore.
Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/csr/oska/Makefile | 1 | ||||
-rw-r--r-- | drivers/staging/csr/oska/oska_module.c | 8 | ||||
-rw-r--r-- | drivers/staging/csr/oska/refcount.c | 47 | ||||
-rw-r--r-- | drivers/staging/csr/oska/refcount.h | 86 |
4 files changed, 0 insertions, 142 deletions
diff --git a/drivers/staging/csr/oska/Makefile b/drivers/staging/csr/oska/Makefile index 57ae66d87491..d2aabb7c5c6e 100644 --- a/drivers/staging/csr/oska/Makefile +++ b/drivers/staging/csr/oska/Makefile | |||
@@ -2,7 +2,6 @@ obj-$(CONFIG_CSR_WIFI) := csr_oska.o | |||
2 | 2 | ||
3 | csr_oska-y := \ | 3 | csr_oska-y := \ |
4 | list.o \ | 4 | list.o \ |
5 | refcount.o \ | ||
6 | event.o \ | 5 | event.o \ |
7 | oska_module.o \ | 6 | oska_module.o \ |
8 | print.o \ | 7 | print.o \ |
diff --git a/drivers/staging/csr/oska/oska_module.c b/drivers/staging/csr/oska/oska_module.c index da125643d2d6..2876ec2ade6b 100644 --- a/drivers/staging/csr/oska/oska_module.c +++ b/drivers/staging/csr/oska/oska_module.c | |||
@@ -8,14 +8,6 @@ | |||
8 | */ | 8 | */ |
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | 10 | ||
11 | #include "all.h" | ||
12 | #include "refcount.h" | ||
13 | |||
14 | EXPORT_SYMBOL(os_refcount_init); | ||
15 | EXPORT_SYMBOL(os_refcount_destroy); | ||
16 | EXPORT_SYMBOL(os_refcount_get); | ||
17 | EXPORT_SYMBOL(os_refcount_put); | ||
18 | |||
19 | MODULE_DESCRIPTION("Operating System Kernel Abstraction"); | 11 | MODULE_DESCRIPTION("Operating System Kernel Abstraction"); |
20 | MODULE_AUTHOR("Cambridge Silicon Radio Ltd."); | 12 | MODULE_AUTHOR("Cambridge Silicon Radio Ltd."); |
21 | MODULE_LICENSE("GPL and additional rights"); | 13 | MODULE_LICENSE("GPL and additional rights"); |
diff --git a/drivers/staging/csr/oska/refcount.c b/drivers/staging/csr/oska/refcount.c deleted file mode 100644 index 28abb64a9d20..000000000000 --- a/drivers/staging/csr/oska/refcount.c +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | /* | ||
2 | * OSKA generic implementation -- reference counting. | ||
3 | * | ||
4 | * Copyright (C) 2010 Cambridge Silicon Radio Ltd. | ||
5 | * | ||
6 | * Refer to LICENSE.txt included with this source code for details on | ||
7 | * the license terms. | ||
8 | */ | ||
9 | #include "refcount.h" | ||
10 | #include "types.h" | ||
11 | |||
12 | void os_refcount_init(os_refcount_t *refcount, os_refcount_callback_f func, void *arg) | ||
13 | { | ||
14 | os_spinlock_init(&refcount->lock); | ||
15 | refcount->count = 1; | ||
16 | refcount->func = func; | ||
17 | refcount->arg = arg; | ||
18 | } | ||
19 | |||
20 | void os_refcount_destroy(os_refcount_t *refcount) | ||
21 | { | ||
22 | os_spinlock_destroy(&refcount->lock); | ||
23 | } | ||
24 | |||
25 | void os_refcount_get(os_refcount_t *refcount) | ||
26 | { | ||
27 | os_int_status_t istate; | ||
28 | |||
29 | os_spinlock_lock_intsave(&refcount->lock, &istate); | ||
30 | refcount->count++; | ||
31 | os_spinlock_unlock_intrestore(&refcount->lock, &istate); | ||
32 | } | ||
33 | |||
34 | void os_refcount_put(os_refcount_t *refcount) | ||
35 | { | ||
36 | bool is_zero; | ||
37 | os_int_status_t istate; | ||
38 | |||
39 | os_spinlock_lock_intsave(&refcount->lock, &istate); | ||
40 | refcount->count--; | ||
41 | is_zero = refcount->count == 0; | ||
42 | os_spinlock_unlock_intrestore(&refcount->lock, &istate); | ||
43 | |||
44 | if (is_zero) { | ||
45 | refcount->func(refcount->arg); | ||
46 | } | ||
47 | } | ||
diff --git a/drivers/staging/csr/oska/refcount.h b/drivers/staging/csr/oska/refcount.h deleted file mode 100644 index 741b00afcdf0..000000000000 --- a/drivers/staging/csr/oska/refcount.h +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | /* | ||
2 | * Operating system kernel abstraction -- reference counting. | ||
3 | * | ||
4 | * Copyright (C) 2010 Cambridge Silicon Radio Ltd. | ||
5 | * | ||
6 | * Refer to LICENSE.txt included with this source code for details on | ||
7 | * the license terms. | ||
8 | */ | ||
9 | #ifndef __OSKA_REFCOUNT_H | ||
10 | #define __OSKA_REFCOUNT_H | ||
11 | |||
12 | #include "spinlock.h" | ||
13 | |||
14 | /** | ||
15 | * @defgroup refcount Reference Counting | ||
16 | * | ||
17 | * A reference count is an atomic counter. A callback function is | ||
18 | * called whenever the count reaches zero. | ||
19 | * | ||
20 | * A generic implementation is provided that is suitable for all | ||
21 | * platforms that support the spinlock API in <oska/spinlock.h> (see | ||
22 | * \ref spinlock). | ||
23 | */ | ||
24 | |||
25 | typedef void (*os_refcount_callback_f)(void *arg); | ||
26 | |||
27 | struct __os_refcount_impl { | ||
28 | unsigned count; | ||
29 | os_spinlock_t lock; | ||
30 | os_refcount_callback_f func; | ||
31 | void *arg; | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * A reference count object. | ||
36 | * | ||
37 | * @ingroup refcount | ||
38 | */ | ||
39 | typedef struct __os_refcount_impl os_refcount_t; | ||
40 | |||
41 | /** | ||
42 | * Initialize a reference count to 1. | ||
43 | * | ||
44 | * Initialized reference counts must be destroyed by calling | ||
45 | * os_refcount_destroy(). | ||
46 | * | ||
47 | * @param refcount the reference count. | ||
48 | * @param func the function which will be called when the | ||
49 | * reference count reaches 0. | ||
50 | * @param arg an argument to pass to func. | ||
51 | * | ||
52 | * @ingroup refcount | ||
53 | */ | ||
54 | void os_refcount_init(os_refcount_t *refcount, os_refcount_callback_f func, void *arg); | ||
55 | |||
56 | /** | ||
57 | * Destroy a reference count object. | ||
58 | * | ||
59 | * @param refcount the reference count. | ||
60 | * | ||
61 | * @ingroup refcount | ||
62 | */ | ||
63 | void os_refcount_destroy(os_refcount_t *refcount); | ||
64 | |||
65 | /** | ||
66 | * Atomically increase the reference count by 1. | ||
67 | * | ||
68 | * @param refcount the reference count. | ||
69 | * | ||
70 | * @ingroup refcount | ||
71 | */ | ||
72 | void os_refcount_get(os_refcount_t *refcount); | ||
73 | |||
74 | /** | ||
75 | * Atomically decrease the reference count by 1. | ||
76 | * | ||
77 | * The callback function passed to the call to os_refcount_init() is | ||
78 | * called if the count was decreased to zero. | ||
79 | * | ||
80 | * @param refcount the reference count. | ||
81 | * | ||
82 | * @ingroup refcount | ||
83 | */ | ||
84 | void os_refcount_put(os_refcount_t *refcount); | ||
85 | |||
86 | #endif /* #ifndef __OSKA_REFCOUNT_H */ | ||