aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/csr/csr_framework_ext.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/csr/csr_framework_ext.c')
-rw-r--r--drivers/staging/csr/csr_framework_ext.c97
1 files changed, 0 insertions, 97 deletions
diff --git a/drivers/staging/csr/csr_framework_ext.c b/drivers/staging/csr/csr_framework_ext.c
index f91a4bf4e68..2aabb6c6b0a 100644
--- a/drivers/staging/csr/csr_framework_ext.c
+++ b/drivers/staging/csr/csr_framework_ext.c
@@ -9,7 +9,6 @@
9*****************************************************************************/ 9*****************************************************************************/
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/version.h>
13#include <linux/kthread.h> 12#include <linux/kthread.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/freezer.h> 14#include <linux/freezer.h>
@@ -18,102 +17,6 @@
18#include <linux/bitops.h> 17#include <linux/bitops.h>
19 18
20#include "csr_framework_ext.h" 19#include "csr_framework_ext.h"
21#include "csr_panic.h"
22
23/*----------------------------------------------------------------------------*
24 * NAME
25 * CsrMutexCreate
26 *
27 * DESCRIPTION
28 * Create a mutex and return a handle to the created mutex.
29 *
30 * RETURNS
31 * Possible values:
32 * CSR_RESULT_SUCCESS in case of success
33 * CSR_FE_RESULT_NO_MORE_MUTEXES in case of out of mutex resources
34 * CSR_FE_RESULT_INVALID_POINTER in case the mutexHandle pointer is invalid
35 *
36 *----------------------------------------------------------------------------*/
37CsrResult CsrMutexCreate(CsrMutexHandle *mutexHandle)
38{
39 if (mutexHandle == NULL)
40 {
41 return CSR_FE_RESULT_INVALID_POINTER;
42 }
43
44 sema_init(mutexHandle, 1);
45
46 return CSR_RESULT_SUCCESS;
47}
48
49/*----------------------------------------------------------------------------*
50 * NAME
51 * CsrMutexDestroy
52 *
53 * DESCRIPTION
54 * Destroy the previously created mutex.
55 *
56 * RETURNS
57 * void
58 *
59 *----------------------------------------------------------------------------*/
60void CsrMutexDestroy(CsrMutexHandle *mutexHandle)
61{
62}
63
64/*----------------------------------------------------------------------------*
65 * NAME
66 * CsrMutexLock
67 *
68 * DESCRIPTION
69 * Lock the mutex refered to by the provided handle.
70 *
71 * RETURNS
72 * Possible values:
73 * CSR_RESULT_SUCCESS in case of success
74 * CSR_FE_RESULT_INVALID_HANDLE in case the mutexHandle is invalid
75 *
76 *----------------------------------------------------------------------------*/
77CsrResult CsrMutexLock(CsrMutexHandle *mutexHandle)
78{
79 if (mutexHandle == NULL)
80 {
81 return CSR_FE_RESULT_INVALID_POINTER;
82 }
83
84 if (down_interruptible(mutexHandle))
85 {
86 CsrPanic(CSR_TECH_FW, CSR_PANIC_FW_UNEXPECTED_VALUE, "CsrMutexLock Failed");
87 return CSR_FE_RESULT_INVALID_POINTER;
88 }
89
90 return CSR_RESULT_SUCCESS;
91}
92
93/*----------------------------------------------------------------------------*
94 * NAME
95 * CsrMutexUnlock
96 *
97 * DESCRIPTION
98 * Unlock the mutex refered to by the provided handle.
99 *
100 * RETURNS
101 * Possible values:
102 * CSR_RESULT_SUCCESS in case of success
103 * CSR_FE_RESULT_INVALID_HANDLE in case the mutexHandle is invalid
104 *
105 *----------------------------------------------------------------------------*/
106CsrResult CsrMutexUnlock(CsrMutexHandle *mutexHandle)
107{
108 if (mutexHandle == NULL)
109 {
110 return CSR_FE_RESULT_INVALID_POINTER;
111 }
112
113 up(mutexHandle);
114
115 return CSR_RESULT_SUCCESS;
116}
117 20
118/*----------------------------------------------------------------------------* 21/*----------------------------------------------------------------------------*
119 * NAME 22 * NAME