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

staging: tidspbridge: remove dev_init() and dev_exit()

The dev module has a dev_init() and a dev_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
a05c5dc3 d071c0e9

+3 -75
-27
drivers/staging/tidspbridge/include/dspbridge/dev.h
··· 478 478 **phbridge_context); 479 479 480 480 /* 481 - * ======== dev_exit ======== 482 - * Purpose: 483 - * Decrement reference count, and free resources when reference count is 484 - * 0. 485 - * Parameters: 486 - * Returns: 487 - * Requires: 488 - * DEV is initialized. 489 - * Ensures: 490 - * When reference count == 0, DEV's private resources are freed. 491 - */ 492 - extern void dev_exit(void); 493 - 494 - /* 495 - * ======== dev_init ======== 496 - * Purpose: 497 - * Initialize DEV's private state, keeping a reference count on each call. 498 - * Parameters: 499 - * Returns: 500 - * TRUE if initialized; FALSE if error occurred. 501 - * Requires: 502 - * Ensures: 503 - * TRUE: A requirement for the other public DEV functions. 504 - */ 505 - extern bool dev_init(void); 506 - 507 - /* 508 481 * ======== dev_insert_proc_object ======== 509 482 * Purpose: 510 483 * Inserts the Processor Object into the List of PROC Objects
-29
drivers/staging/tidspbridge/pmgr/dev.c
··· 81 81 char sz_string[MAXREGPATHLENGTH]; 82 82 }; 83 83 84 - /* ----------------------------------- Globals */ 85 - static u32 refs; /* Module reference count */ 86 - 87 84 /* ----------------------------------- Function Prototypes */ 88 85 static int fxn_not_implemented(int arg, ...); 89 86 static int init_cod_mgr(struct dev_object *dev_obj); ··· 643 646 } 644 647 645 648 return status; 646 - } 647 - 648 - /* 649 - * ======== dev_exit ======== 650 - * Purpose: 651 - * Decrement reference count, and free resources when reference count is 652 - * 0. 653 - */ 654 - void dev_exit(void) 655 - { 656 - refs--; 657 - } 658 - 659 - /* 660 - * ======== dev_init ======== 661 - * Purpose: 662 - * Initialize DEV's private state, keeping a reference count on each call. 663 - */ 664 - bool dev_init(void) 665 - { 666 - bool ret = true; 667 - 668 - if (ret) 669 - refs++; 670 - 671 - return ret; 672 649 } 673 650 674 651 /*
+3 -19
drivers/staging/tidspbridge/pmgr/dspapi.c
··· 265 265 { 266 266 api_c_refs--; 267 267 268 - if (api_c_refs == 0) { 269 - /* Release all modules initialized in api_init(). */ 270 - dev_exit(); 268 + if (api_c_refs == 0) 271 269 mgr_exit(); 272 - } 273 270 } 274 271 275 272 /* ··· 277 280 bool api_init(void) 278 281 { 279 282 bool ret = true; 280 - bool fdev; 281 - bool fmgr; 282 283 283 - if (api_c_refs == 0) { 284 - /* initialize driver and other modules */ 285 - fmgr = mgr_init(); 286 - fdev = dev_init(); 287 - ret = fdev && fmgr; 288 - if (!ret) { 284 + if (api_c_refs == 0) 285 + ret = mgr_init(); 289 286 290 - if (fmgr) 291 - mgr_exit(); 292 - 293 - if (fdev) 294 - dev_exit(); 295 - } 296 - } 297 287 if (ret) 298 288 api_c_refs++; 299 289