]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: tidspbridge: remove dev_init() and dev_exit()
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Fri, 9 Mar 2012 00:03:48 +0000 (01:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Mar 2012 21:21:08 +0000 (13:21 -0800)
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>
drivers/staging/tidspbridge/include/dspbridge/dev.h
drivers/staging/tidspbridge/pmgr/dev.c
drivers/staging/tidspbridge/pmgr/dspapi.c

index f92b4be0b413da1ae056a689398b00980ede3a77..fa2d79ef6cc841e0aaf9c35bc40990e6bb1490a0 100644 (file)
@@ -477,33 +477,6 @@ extern int dev_get_bridge_context(struct dev_object *hdev_obj,
                                      struct bridge_dev_context
                                      **phbridge_context);
 
-/*
- *  ======== dev_exit ========
- *  Purpose:
- *      Decrement reference count, and free resources when reference count is
- *      0.
- *  Parameters:
- *  Returns:
- *  Requires:
- *      DEV is initialized.
- *  Ensures:
- *      When reference count == 0, DEV's private resources are freed.
- */
-extern void dev_exit(void);
-
-/*
- *  ======== dev_init ========
- *  Purpose:
- *      Initialize DEV's private state, keeping a reference count on each call.
- *  Parameters:
- *  Returns:
- *      TRUE if initialized; FALSE if error occurred.
- *  Requires:
- *  Ensures:
- *      TRUE: A requirement for the other public DEV functions.
- */
-extern bool dev_init(void);
-
 /*
  *  ======== dev_insert_proc_object ========
  *  Purpose:
index c5e627ce8b8f551745d1e0794907b50c967a23dc..6234ffb5e8a3998275ca6c7d3b93947df706a0e9 100644 (file)
@@ -81,9 +81,6 @@ struct drv_ext {
        char sz_string[MAXREGPATHLENGTH];
 };
 
-/*  ----------------------------------- Globals */
-static u32 refs;               /* Module reference count */
-
 /*  ----------------------------------- Function Prototypes */
 static int fxn_not_implemented(int arg, ...);
 static int init_cod_mgr(struct dev_object *dev_obj);
@@ -648,32 +645,6 @@ int dev_get_bridge_context(struct dev_object *hdev_obj,
        return status;
 }
 
-/*
- *  ======== dev_exit ========
- *  Purpose:
- *      Decrement reference count, and free resources when reference count is
- *      0.
- */
-void dev_exit(void)
-{
-       refs--;
-}
-
-/*
- *  ======== dev_init ========
- *  Purpose:
- *      Initialize DEV's private state, keeping a reference count on each call.
- */
-bool dev_init(void)
-{
-       bool ret = true;
-
-       if (ret)
-               refs++;
-
-       return ret;
-}
-
 /*
  *  ======== dev_notify_clients ========
  *  Purpose:
index b9ca24c18e131712d98f6cb5dff72141bd2a7a88..9ef1ad9527afe4c32a7f5653b9d62dde944c9853 100644 (file)
@@ -265,11 +265,8 @@ void api_exit(void)
 {
        api_c_refs--;
 
-       if (api_c_refs == 0) {
-               /* Release all modules initialized in api_init(). */
-               dev_exit();
+       if (api_c_refs == 0)
                mgr_exit();
-       }
 }
 
 /*
@@ -280,23 +277,10 @@ void api_exit(void)
 bool api_init(void)
 {
        bool ret = true;
-       bool fdev;
-       bool fmgr;
-
-       if (api_c_refs == 0) {
-               /* initialize driver and other modules */
-               fmgr = mgr_init();
-               fdev = dev_init();
-               ret = fdev && fmgr;
-               if (!ret) {
 
-                       if (fmgr)
-                               mgr_exit();
+       if (api_c_refs == 0)
+               ret = mgr_init();
 
-                       if (fdev)
-                               dev_exit();
-               }
-       }
        if (ret)
                api_c_refs++;