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

staging: tidspbridge: remove cod_init() and cod_exit()

The cod module has a cod_init() and a cod_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
d4040fad 1f2cd527

+3 -79
-29
drivers/staging/tidspbridge/include/dspbridge/cod.h
··· 100 100 extern void cod_delete(struct cod_manager *cod_mgr_obj); 101 101 102 102 /* 103 - * ======== cod_exit ======== 104 - * Purpose: 105 - * Discontinue usage of the COD module. 106 - * Parameters: 107 - * None. 108 - * Returns: 109 - * None. 110 - * Requires: 111 - * COD initialized. 112 - * Ensures: 113 - * Resources acquired in cod_init(void) are freed. 114 - */ 115 - extern void cod_exit(void); 116 - 117 - /* 118 103 * ======== cod_get_base_lib ======== 119 104 * Purpose: 120 105 * Get handle to the base image DBL library. ··· 226 241 */ 227 242 extern int cod_get_sym_value(struct cod_manager *cod_mgr_obj, 228 243 char *str_sym, u32 * pul_value); 229 - 230 - /* 231 - * ======== cod_init ======== 232 - * Purpose: 233 - * Initialize the COD module's private state. 234 - * Parameters: 235 - * None. 236 - * Returns: 237 - * TRUE if initialized; FALSE if error occurred. 238 - * Requires: 239 - * Ensures: 240 - * A requirement for each of the other public COD functions. 241 - */ 242 - extern bool cod_init(void); 243 244 244 245 /* 245 246 * ======== cod_load_base ========
-29
drivers/staging/tidspbridge/pmgr/cod.c
··· 58 58 struct cod_manager *cod_mgr; 59 59 }; 60 60 61 - static u32 refs = 0L; 62 - 63 61 static struct dbll_fxns ldr_fxns = { 64 62 (dbll_close_fxn) dbll_close, 65 63 (dbll_create_fxn) dbll_create, ··· 266 268 } 267 269 268 270 /* 269 - * ======== cod_exit ======== 270 - * Purpose: 271 - * Discontinue usage of the COD module. 272 - * 273 - */ 274 - void cod_exit(void) 275 - { 276 - refs--; 277 - } 278 - 279 - /* 280 271 * ======== cod_get_base_lib ======== 281 272 * Purpose: 282 273 * Get handle to the base image DBL library. ··· 379 392 *pul_value = dbll_sym->value; 380 393 381 394 return 0; 382 - } 383 - 384 - /* 385 - * ======== cod_init ======== 386 - * Purpose: 387 - * Initialize the COD module's private state. 388 - * 389 - */ 390 - bool cod_init(void) 391 - { 392 - bool ret = true; 393 - 394 - if (ret) 395 - refs++; 396 - 397 - return ret; 398 395 } 399 396 400 397 /*
+2 -7
drivers/staging/tidspbridge/pmgr/dspapi.c
··· 267 267 268 268 if (api_c_refs == 0) { 269 269 /* Release all modules initialized in api_init(). */ 270 - cod_exit(); 271 270 dev_exit(); 272 271 chnl_exit(); 273 272 msg_exit(); ··· 288 289 bool api_init(void) 289 290 { 290 291 bool ret = true; 291 - bool fdev, fcod, fchnl, fmsg, fio; 292 + bool fdev, fchnl, fmsg, fio; 292 293 bool fmgr, fproc, fnode, fdisp, fstrm, frmm; 293 294 294 295 if (api_c_refs == 0) { ··· 303 304 fmsg = msg_mod_init(); 304 305 fio = io_init(); 305 306 fdev = dev_init(); 306 - fcod = cod_init(); 307 - ret = fdev && fchnl && fcod && fmsg && fio; 307 + ret = fdev && fchnl && fmsg && fio; 308 308 ret = ret && fmgr && fproc && frmm; 309 309 if (!ret) { 310 310 ··· 333 335 334 336 if (fdev) 335 337 dev_exit(); 336 - 337 - if (fcod) 338 - cod_exit(); 339 338 340 339 if (frmm) 341 340 rmm_exit();
+1 -14
drivers/staging/tidspbridge/rmgr/dbdcd.c
··· 289 289 290 290 refs--; 291 291 if (refs == 0) { 292 - cod_exit(); 293 292 list_for_each_entry_safe(rv, rv_tmp, &reg_key_list, link) { 294 293 list_del(&rv->link); 295 294 kfree(rv->path); ··· 737 738 */ 738 739 bool dcd_init(void) 739 740 { 740 - bool init_cod; 741 741 bool ret = true; 742 742 743 - if (refs == 0) { 744 - /* Initialize required modules. */ 745 - init_cod = cod_init(); 746 - 747 - if (!init_cod) { 748 - ret = false; 749 - /* Exit initialized modules. */ 750 - if (init_cod) 751 - cod_exit(); 752 - } 753 - 743 + if (refs == 0) 754 744 INIT_LIST_HEAD(&reg_key_list); 755 - } 756 745 757 746 if (ret) 758 747 refs++;