Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Víctor Manuel Jáquez Leal and committed by
Greg Kroah-Hartman
311abd9a 2f69a43b

+2 -71
+1 -37
drivers/staging/tidspbridge/include/dspbridge/strm.h
··· 40 40 * -EPERM: Failure occurred, unable to allocate buffers. 41 41 * -EINVAL: usize must be > 0 bytes. 42 42 * Requires: 43 - * strm_init(void) called. 44 43 * ap_buffer != NULL. 45 44 * Ensures: 46 45 */ ··· 62 63 * been reclaimed. 63 64 * -EPERM: Failure to close stream. 64 65 * Requires: 65 - * strm_init(void) called. 66 66 * Ensures: 67 67 */ 68 68 extern int strm_close(struct strm_res_object *strmres, ··· 81 83 * -ENOMEM: Insufficient memory for requested resources. 82 84 * -EPERM: General failure. 83 85 * Requires: 84 - * strm_init(void) called. 85 86 * strm_man != NULL. 86 87 * dev_obj != NULL. 87 88 * Ensures: ··· 98 101 * strm_mgr_obj: Handle to STRM manager object from strm_create. 99 102 * Returns: 100 103 * Requires: 101 - * strm_init(void) called. 102 104 * Valid strm_mgr_obj. 103 105 * Ensures: 104 106 * strm_mgr_obj is not valid. 105 107 */ 106 108 extern void strm_delete(struct strm_mgr *strm_mgr_obj); 107 - 108 - /* 109 - * ======== strm_exit ======== 110 - * Purpose: 111 - * Discontinue usage of STRM module. 112 - * Parameters: 113 - * Returns: 114 - * Requires: 115 - * strm_init(void) successfully called before. 116 - * Ensures: 117 - */ 118 - extern void strm_exit(void); 119 109 120 110 /* 121 111 * ======== strm_free_buffer ======== ··· 117 133 * -EFAULT: Invalid stream handle. 118 134 * -EPERM: Failure occurred, unable to free buffers. 119 135 * Requires: 120 - * strm_init(void) called. 121 136 * ap_buffer != NULL. 122 137 * Ensures: 123 138 */ ··· 139 156 * -EINVAL: stream_info_size < sizeof(dsp_streaminfo). 140 157 * -EPERM: Unable to get stream info. 141 158 * Requires: 142 - * strm_init(void) called. 143 159 * stream_info != NULL. 144 160 * Ensures: 145 161 */ ··· 166 184 * -ETIME: A timeout occurred before the stream could be idled. 167 185 * -EPERM: Unable to idle stream. 168 186 * Requires: 169 - * strm_init(void) called. 170 187 * Ensures: 171 188 */ 172 189 extern int strm_idle(struct strm_object *stream_obj, bool flush_data); 173 - 174 - /* 175 - * ======== strm_init ======== 176 - * Purpose: 177 - * Initialize the STRM module. 178 - * Parameters: 179 - * Returns: 180 - * TRUE if initialization succeeded, FALSE otherwise. 181 - * Requires: 182 - * Ensures: 183 - */ 184 - extern bool strm_init(void); 185 190 186 191 /* 187 192 * ======== strm_issue ======== ··· 186 217 * -ENOSR: The stream is full. 187 218 * -EPERM: Failure occurred, unable to issue buffer. 188 219 * Requires: 189 - * strm_init(void) called. 190 - * pbuf != NULL. 220 + * pbuf != NULL. 191 221 * Ensures: 192 222 */ 193 223 extern int strm_issue(struct strm_object *stream_obj, u8 * pbuf, ··· 212 244 * Unable to open stream. 213 245 * -EINVAL: Invalid index. 214 246 * Requires: 215 - * strm_init(void) called. 216 247 * strmres != NULL. 217 248 * pattr != NULL. 218 249 * Ensures: ··· 242 275 * retrieved. 243 276 * -EPERM: Failure occurred, unable to reclaim buffer. 244 277 * Requires: 245 - * strm_init(void) called. 246 278 * buf_ptr != NULL. 247 279 * nbytes != NULL. 248 280 * pdw_arg != NULL. ··· 268 302 * -ENOSYS: Notification type specified by notify_type is not 269 303 * supported. 270 304 * Requires: 271 - * strm_init(void) called. 272 305 * hnotification != NULL. 273 306 * Ensures: 274 307 */ ··· 293 328 * -ETIME: A timeout occurred before a stream became ready. 294 329 * -EPERM: Failure occurred, unable to select a stream. 295 330 * Requires: 296 - * strm_init(void) called. 297 331 * strm_tab != NULL. 298 332 * strms > 0. 299 333 * pmask != NULL.
+1 -6
drivers/staging/tidspbridge/pmgr/dspapi.c
··· 271 271 chnl_exit(); 272 272 msg_exit(); 273 273 io_exit(); 274 - strm_exit(); 275 274 mgr_exit(); 276 275 rmm_exit(); 277 276 } ··· 285 286 { 286 287 bool ret = true; 287 288 bool fdev, fchnl, fmsg, fio; 288 - bool fmgr, fstrm, frmm; 289 + bool fmgr, frmm; 289 290 290 291 if (api_c_refs == 0) { 291 292 /* initialize driver and other modules */ 292 293 fmgr = mgr_init(); 293 - fstrm = strm_init(); 294 294 frmm = rmm_init(); 295 295 fchnl = chnl_init(); 296 296 fmsg = msg_mod_init(); ··· 301 303 302 304 if (fmgr) 303 305 mgr_exit(); 304 - 305 - if (fstrm) 306 - strm_exit(); 307 306 308 307 if (fchnl) 309 308 chnl_exit();
-28
drivers/staging/tidspbridge/rmgr/strm.c
··· 81 81 struct cmm_xlatorobject *xlator; 82 82 }; 83 83 84 - /* ----------------------------------- Globals */ 85 - static u32 refs; /* module reference count */ 86 - 87 84 /* ----------------------------------- Function Prototypes */ 88 85 static int delete_strm(struct strm_object *stream_obj); 89 86 ··· 219 222 } 220 223 221 224 /* 222 - * ======== strm_exit ======== 223 - * Purpose: 224 - * Discontinue usage of STRM module. 225 - */ 226 - void strm_exit(void) 227 - { 228 - refs--; 229 - } 230 - 231 - /* 232 225 * ======== strm_free_buffer ======== 233 226 * Purpose: 234 227 * Frees the buffers allocated for a stream. ··· 334 347 dev_dbg(bridge, "%s: stream_obj: %p flush_data: 0x%x status: 0x%x\n", 335 348 __func__, stream_obj, flush_data, status); 336 349 return status; 337 - } 338 - 339 - /* 340 - * ======== strm_init ======== 341 - * Purpose: 342 - * Initialize the STRM module. 343 - */ 344 - bool strm_init(void) 345 - { 346 - bool ret = true; 347 - 348 - if (ret) 349 - refs++; 350 - 351 - return ret; 352 350 } 353 351 354 352 /*