aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/tidspbridge
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2012-03-08 19:03:41 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-09 16:21:06 -0500
commit311abd9ac44f72f4d10adaaf3af1c273b0f71db8 (patch)
treefe2f26e5690b42909d2155b75464f56b3c8a5490 /drivers/staging/tidspbridge
parent2f69a43b8f5befc3d110c22a2823170f720432ff (diff)
staging: tidspbridge: remove strm_init() and strm_exit()
The strm module has a strm_init() and a strm_exit() whose only purpose is to keep a reference counting which is not used at all. This patch removes these functions and the reference count variable. There is no functional changes. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/tidspbridge')
-rw-r--r--drivers/staging/tidspbridge/include/dspbridge/strm.h38
-rw-r--r--drivers/staging/tidspbridge/pmgr/dspapi.c7
-rw-r--r--drivers/staging/tidspbridge/rmgr/strm.c28
3 files changed, 2 insertions, 71 deletions
diff --git a/drivers/staging/tidspbridge/include/dspbridge/strm.h b/drivers/staging/tidspbridge/include/dspbridge/strm.h
index 613fe53dd23..dacf0c234fd 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/strm.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/strm.h
@@ -40,7 +40,6 @@
40 * -EPERM: Failure occurred, unable to allocate buffers. 40 * -EPERM: Failure occurred, unable to allocate buffers.
41 * -EINVAL: usize must be > 0 bytes. 41 * -EINVAL: usize must be > 0 bytes.
42 * Requires: 42 * Requires:
43 * strm_init(void) called.
44 * ap_buffer != NULL. 43 * ap_buffer != NULL.
45 * Ensures: 44 * Ensures:
46 */ 45 */
@@ -63,7 +62,6 @@ extern int strm_allocate_buffer(struct strm_res_object *strmres,
63 * been reclaimed. 62 * been reclaimed.
64 * -EPERM: Failure to close stream. 63 * -EPERM: Failure to close stream.
65 * Requires: 64 * Requires:
66 * strm_init(void) called.
67 * Ensures: 65 * Ensures:
68 */ 66 */
69extern int strm_close(struct strm_res_object *strmres, 67extern int strm_close(struct strm_res_object *strmres,
@@ -83,7 +81,6 @@ extern int strm_close(struct strm_res_object *strmres,
83 * -ENOMEM: Insufficient memory for requested resources. 81 * -ENOMEM: Insufficient memory for requested resources.
84 * -EPERM: General failure. 82 * -EPERM: General failure.
85 * Requires: 83 * Requires:
86 * strm_init(void) called.
87 * strm_man != NULL. 84 * strm_man != NULL.
88 * dev_obj != NULL. 85 * dev_obj != NULL.
89 * Ensures: 86 * Ensures:
@@ -101,7 +98,6 @@ extern int strm_create(struct strm_mgr **strm_man,
101 * strm_mgr_obj: Handle to STRM manager object from strm_create. 98 * strm_mgr_obj: Handle to STRM manager object from strm_create.
102 * Returns: 99 * Returns:
103 * Requires: 100 * Requires:
104 * strm_init(void) called.
105 * Valid strm_mgr_obj. 101 * Valid strm_mgr_obj.
106 * Ensures: 102 * Ensures:
107 * strm_mgr_obj is not valid. 103 * strm_mgr_obj is not valid.
@@ -109,18 +105,6 @@ extern int strm_create(struct strm_mgr **strm_man,
109extern void strm_delete(struct strm_mgr *strm_mgr_obj); 105extern void strm_delete(struct strm_mgr *strm_mgr_obj);
110 106
111/* 107/*
112 * ======== strm_exit ========
113 * Purpose:
114 * Discontinue usage of STRM module.
115 * Parameters:
116 * Returns:
117 * Requires:
118 * strm_init(void) successfully called before.
119 * Ensures:
120 */
121extern void strm_exit(void);
122
123/*
124 * ======== strm_free_buffer ======== 108 * ======== strm_free_buffer ========
125 * Purpose: 109 * Purpose:
126 * Free buffer(s) allocated with strm_allocate_buffer. 110 * Free buffer(s) allocated with strm_allocate_buffer.
@@ -133,7 +117,6 @@ extern void strm_exit(void);
133 * -EFAULT: Invalid stream handle. 117 * -EFAULT: Invalid stream handle.
134 * -EPERM: Failure occurred, unable to free buffers. 118 * -EPERM: Failure occurred, unable to free buffers.
135 * Requires: 119 * Requires:
136 * strm_init(void) called.
137 * ap_buffer != NULL. 120 * ap_buffer != NULL.
138 * Ensures: 121 * Ensures:
139 */ 122 */
@@ -156,7 +139,6 @@ extern int strm_free_buffer(struct strm_res_object *strmres,
156 * -EINVAL: stream_info_size < sizeof(dsp_streaminfo). 139 * -EINVAL: stream_info_size < sizeof(dsp_streaminfo).
157 * -EPERM: Unable to get stream info. 140 * -EPERM: Unable to get stream info.
158 * Requires: 141 * Requires:
159 * strm_init(void) called.
160 * stream_info != NULL. 142 * stream_info != NULL.
161 * Ensures: 143 * Ensures:
162 */ 144 */
@@ -184,24 +166,11 @@ extern int strm_get_info(struct strm_object *stream_obj,
184 * -ETIME: A timeout occurred before the stream could be idled. 166 * -ETIME: A timeout occurred before the stream could be idled.
185 * -EPERM: Unable to idle stream. 167 * -EPERM: Unable to idle stream.
186 * Requires: 168 * Requires:
187 * strm_init(void) called.
188 * Ensures: 169 * Ensures:
189 */ 170 */
190extern int strm_idle(struct strm_object *stream_obj, bool flush_data); 171extern int strm_idle(struct strm_object *stream_obj, bool flush_data);
191 172
192/* 173/*
193 * ======== strm_init ========
194 * Purpose:
195 * Initialize the STRM module.
196 * Parameters:
197 * Returns:
198 * TRUE if initialization succeeded, FALSE otherwise.
199 * Requires:
200 * Ensures:
201 */
202extern bool strm_init(void);
203
204/*
205 * ======== strm_issue ======== 174 * ======== strm_issue ========
206 * Purpose: 175 * Purpose:
207 * Send a buffer of data to a stream. 176 * Send a buffer of data to a stream.
@@ -217,8 +186,7 @@ extern bool strm_init(void);
217 * -ENOSR: The stream is full. 186 * -ENOSR: The stream is full.
218 * -EPERM: Failure occurred, unable to issue buffer. 187 * -EPERM: Failure occurred, unable to issue buffer.
219 * Requires: 188 * Requires:
220 * strm_init(void) called. 189* pbuf != NULL.
221 * pbuf != NULL.
222 * Ensures: 190 * Ensures:
223 */ 191 */
224extern int strm_issue(struct strm_object *stream_obj, u8 * pbuf, 192extern int strm_issue(struct strm_object *stream_obj, u8 * pbuf,
@@ -244,7 +212,6 @@ extern int strm_issue(struct strm_object *stream_obj, u8 * pbuf,
244 * Unable to open stream. 212 * Unable to open stream.
245 * -EINVAL: Invalid index. 213 * -EINVAL: Invalid index.
246 * Requires: 214 * Requires:
247 * strm_init(void) called.
248 * strmres != NULL. 215 * strmres != NULL.
249 * pattr != NULL. 216 * pattr != NULL.
250 * Ensures: 217 * Ensures:
@@ -275,7 +242,6 @@ extern int strm_open(struct node_object *hnode, u32 dir,
275 * retrieved. 242 * retrieved.
276 * -EPERM: Failure occurred, unable to reclaim buffer. 243 * -EPERM: Failure occurred, unable to reclaim buffer.
277 * Requires: 244 * Requires:
278 * strm_init(void) called.
279 * buf_ptr != NULL. 245 * buf_ptr != NULL.
280 * nbytes != NULL. 246 * nbytes != NULL.
281 * pdw_arg != NULL. 247 * pdw_arg != NULL.
@@ -302,7 +268,6 @@ extern int strm_reclaim(struct strm_object *stream_obj,
302 * -ENOSYS: Notification type specified by notify_type is not 268 * -ENOSYS: Notification type specified by notify_type is not
303 * supported. 269 * supported.
304 * Requires: 270 * Requires:
305 * strm_init(void) called.
306 * hnotification != NULL. 271 * hnotification != NULL.
307 * Ensures: 272 * Ensures:
308 */ 273 */
@@ -328,7 +293,6 @@ extern int strm_register_notify(struct strm_object *stream_obj,
328 * -ETIME: A timeout occurred before a stream became ready. 293 * -ETIME: A timeout occurred before a stream became ready.
329 * -EPERM: Failure occurred, unable to select a stream. 294 * -EPERM: Failure occurred, unable to select a stream.
330 * Requires: 295 * Requires:
331 * strm_init(void) called.
332 * strm_tab != NULL. 296 * strm_tab != NULL.
333 * strms > 0. 297 * strms > 0.
334 * pmask != NULL. 298 * pmask != NULL.
diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c
index b1a99f76694..06e3b244f83 100644
--- a/drivers/staging/tidspbridge/pmgr/dspapi.c
+++ b/drivers/staging/tidspbridge/pmgr/dspapi.c
@@ -271,7 +271,6 @@ void api_exit(void)
271 chnl_exit(); 271 chnl_exit();
272 msg_exit(); 272 msg_exit();
273 io_exit(); 273 io_exit();
274 strm_exit();
275 mgr_exit(); 274 mgr_exit();
276 rmm_exit(); 275 rmm_exit();
277 } 276 }
@@ -286,12 +285,11 @@ bool api_init(void)
286{ 285{
287 bool ret = true; 286 bool ret = true;
288 bool fdev, fchnl, fmsg, fio; 287 bool fdev, fchnl, fmsg, fio;
289 bool fmgr, fstrm, frmm; 288 bool fmgr, frmm;
290 289
291 if (api_c_refs == 0) { 290 if (api_c_refs == 0) {
292 /* initialize driver and other modules */ 291 /* initialize driver and other modules */
293 fmgr = mgr_init(); 292 fmgr = mgr_init();
294 fstrm = strm_init();
295 frmm = rmm_init(); 293 frmm = rmm_init();
296 fchnl = chnl_init(); 294 fchnl = chnl_init();
297 fmsg = msg_mod_init(); 295 fmsg = msg_mod_init();
@@ -304,9 +302,6 @@ bool api_init(void)
304 if (fmgr) 302 if (fmgr)
305 mgr_exit(); 303 mgr_exit();
306 304
307 if (fstrm)
308 strm_exit();
309
310 if (fchnl) 305 if (fchnl)
311 chnl_exit(); 306 chnl_exit();
312 307
diff --git a/drivers/staging/tidspbridge/rmgr/strm.c b/drivers/staging/tidspbridge/rmgr/strm.c
index bd684f16bae..34cc934e0c3 100644
--- a/drivers/staging/tidspbridge/rmgr/strm.c
+++ b/drivers/staging/tidspbridge/rmgr/strm.c
@@ -81,9 +81,6 @@ struct strm_object {
81 struct cmm_xlatorobject *xlator; 81 struct cmm_xlatorobject *xlator;
82}; 82};
83 83
84/* ----------------------------------- Globals */
85static u32 refs; /* module reference count */
86
87/* ----------------------------------- Function Prototypes */ 84/* ----------------------------------- Function Prototypes */
88static int delete_strm(struct strm_object *stream_obj); 85static int delete_strm(struct strm_object *stream_obj);
89 86
@@ -222,16 +219,6 @@ void strm_delete(struct strm_mgr *strm_mgr_obj)
222} 219}
223 220
224/* 221/*
225 * ======== strm_exit ========
226 * Purpose:
227 * Discontinue usage of STRM module.
228 */
229void strm_exit(void)
230{
231 refs--;
232}
233
234/*
235 * ======== strm_free_buffer ======== 222 * ======== strm_free_buffer ========
236 * Purpose: 223 * Purpose:
237 * Frees the buffers allocated for a stream. 224 * Frees the buffers allocated for a stream.
@@ -350,21 +337,6 @@ int strm_idle(struct strm_object *stream_obj, bool flush_data)
350} 337}
351 338
352/* 339/*
353 * ======== strm_init ========
354 * Purpose:
355 * Initialize the STRM module.
356 */
357bool strm_init(void)
358{
359 bool ret = true;
360
361 if (ret)
362 refs++;
363
364 return ret;
365}
366
367/*
368 * ======== strm_issue ======== 340 * ======== strm_issue ========
369 * Purpose: 341 * Purpose:
370 * Issues a buffer on a stream 342 * Issues a buffer on a stream