summaryrefslogtreecommitdiff
path: root/drivers/staging/tidspbridge/pmgr
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2012-03-09 04:03:46 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-10 01:21:07 +0400
commita71aa396eec042606b9722745d4aa4159bde2e87 (patch)
treef0d88ca1c69cbd2baddd0a3ace2f5dbf1f2bd80f /drivers/staging/tidspbridge/pmgr
parentb4aac487b0db55dcd8587908c129d9dade2bf3df (diff)
downloadlinux-a71aa396eec042606b9722745d4aa4159bde2e87.tar.xz
staging: tidspbridge: remove cmm_init() and cmm_exit()
The cmm module has a cmm_init() and a cmm_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/pmgr')
-rw-r--r--drivers/staging/tidspbridge/pmgr/cmm.c29
-rw-r--r--drivers/staging/tidspbridge/pmgr/dev.c23
2 files changed, 4 insertions, 48 deletions
diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c b/drivers/staging/tidspbridge/pmgr/cmm.c
index 3366e601009d..4a800dadd703 100644
--- a/drivers/staging/tidspbridge/pmgr/cmm.c
+++ b/drivers/staging/tidspbridge/pmgr/cmm.c
@@ -131,9 +131,6 @@ struct cmm_mnode {
u32 client_proc; /* Process that allocated this mem block */
};
-/* ----------------------------------- Globals */
-static u32 refs; /* module reference count */
-
/* ----------------------------------- Function Prototypes */
static void add_to_free_list(struct cmm_allocator *allocator,
struct cmm_mnode *pnode);
@@ -317,17 +314,6 @@ int cmm_destroy(struct cmm_object *hcmm_mgr, bool force)
}
/*
- * ======== cmm_exit ========
- * Purpose:
- * Discontinue usage of module; free resources when reference count
- * reaches 0.
- */
-void cmm_exit(void)
-{
- refs--;
-}
-
-/*
* ======== cmm_free_buf ========
* Purpose:
* Free the given buffer.
@@ -446,21 +432,6 @@ int cmm_get_info(struct cmm_object *hcmm_mgr,
}
/*
- * ======== cmm_init ========
- * Purpose:
- * Initializes private state of CMM module.
- */
-bool cmm_init(void)
-{
- bool ret = true;
-
- if (ret)
- refs++;
-
- return ret;
-}
-
-/*
* ======== cmm_register_gppsm_seg ========
* Purpose:
* Register a block of SM with the CMM to be used for later GPP SM
diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c
index 883765e3c851..734d47ed9a80 100644
--- a/drivers/staging/tidspbridge/pmgr/dev.c
+++ b/drivers/staging/tidspbridge/pmgr/dev.c
@@ -658,10 +658,8 @@ void dev_exit(void)
{
refs--;
- if (refs == 0) {
- cmm_exit();
+ if (refs == 0)
dmm_exit();
- }
}
/*
@@ -671,23 +669,10 @@ void dev_exit(void)
*/
bool dev_init(void)
{
- bool cmm_ret, dmm_ret, ret = true;
-
- if (refs == 0) {
- cmm_ret = cmm_init();
- dmm_ret = dmm_init();
-
- ret = cmm_ret && dmm_ret;
-
- if (!ret) {
- if (cmm_ret)
- cmm_exit();
+ bool ret = true;
- if (dmm_ret)
- dmm_exit();
-
- }
- }
+ if (refs == 0)
+ dmm_init();
if (ret)
refs++;