Commit 7d1d6283 authored by Ernesto Ramos's avatar Ernesto Ramos Committed by Greg Kroah-Hartman

staging: ti dspbridge: remove cmm_xlator_delete wrapper

Resending this patch since it was missed in the last merge...

Remove unnecessary cmm_xlator_delete function and use
kfree() kernel function directly.
Signed-off-by: default avatarErnesto Ramos <ernesto@ti.com>
Signed-off-by: default avatarOmar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 44a17eff
...@@ -299,25 +299,6 @@ extern int cmm_xlator_create(struct cmm_xlatorobject **xlator, ...@@ -299,25 +299,6 @@ extern int cmm_xlator_create(struct cmm_xlatorobject **xlator,
struct cmm_object *hcmm_mgr, struct cmm_object *hcmm_mgr,
struct cmm_xlatorattrs *xlator_attrs); struct cmm_xlatorattrs *xlator_attrs);
/*
* ======== cmm_xlator_delete ========
* Purpose:
* Delete translator resources
* Parameters:
* xlator: handle to translator.
* force: force = TRUE will free XLators SM buffers/dscriptrs.
* Returns:
* 0: Success.
* -EFAULT: Bad translator handle.
* -EPERM: Unable to free translator resources.
* Requires:
* refs > 0
* Ensures:
*
*/
extern int cmm_xlator_delete(struct cmm_xlatorobject *xlator,
bool force);
/* /*
* ======== cmm_xlator_free_buf ======== * ======== cmm_xlator_free_buf ========
* Purpose: * Purpose:
......
...@@ -967,23 +967,6 @@ int cmm_xlator_create(struct cmm_xlatorobject **xlator, ...@@ -967,23 +967,6 @@ int cmm_xlator_create(struct cmm_xlatorobject **xlator,
return status; return status;
} }
/*
* ======== cmm_xlator_delete ========
* Purpose:
* Free the Xlator resources.
* VM gets freed later.
*/
int cmm_xlator_delete(struct cmm_xlatorobject *xlator, bool force)
{
struct cmm_xlator *xlator_obj = (struct cmm_xlator *)xlator;
DBC_REQUIRE(refs > 0);
kfree(xlator_obj);
return 0;
}
/* /*
* ======== cmm_xlator_alloc_buf ======== * ======== cmm_xlator_alloc_buf ========
*/ */
......
...@@ -2505,7 +2505,6 @@ static void delete_node(struct node_object *hnode, ...@@ -2505,7 +2505,6 @@ static void delete_node(struct node_object *hnode,
struct process_context *pr_ctxt) struct process_context *pr_ctxt)
{ {
struct node_mgr *hnode_mgr; struct node_mgr *hnode_mgr;
struct cmm_xlatorobject *xlator;
struct bridge_drv_interface *intf_fxns; struct bridge_drv_interface *intf_fxns;
u32 i; u32 i;
enum node_type node_type; enum node_type node_type;
...@@ -2523,7 +2522,7 @@ static void delete_node(struct node_object *hnode, ...@@ -2523,7 +2522,7 @@ static void delete_node(struct node_object *hnode,
hnode_mgr = hnode->hnode_mgr; hnode_mgr = hnode->hnode_mgr;
if (!hnode_mgr) if (!hnode_mgr)
goto func_end; goto func_end;
xlator = hnode->xlator;
node_type = node_get_type(hnode); node_type = node_get_type(hnode);
if (node_type != NODE_DEVICE) { if (node_type != NODE_DEVICE) {
node_msg_args = hnode->create_args.asa.node_msg_args; node_msg_args = hnode->create_args.asa.node_msg_args;
...@@ -2619,11 +2618,7 @@ static void delete_node(struct node_object *hnode, ...@@ -2619,11 +2618,7 @@ static void delete_node(struct node_object *hnode,
hnode->dcd_props.obj_data.node_obj.pstr_i_alg_name = NULL; hnode->dcd_props.obj_data.node_obj.pstr_i_alg_name = NULL;
/* Free all SM address translator resources */ /* Free all SM address translator resources */
if (xlator) { kfree(hnode->xlator);
(void)cmm_xlator_delete(xlator, true); /* force free */
xlator = NULL;
}
kfree(hnode->nldr_node_obj); kfree(hnode->nldr_node_obj);
hnode->nldr_node_obj = NULL; hnode->nldr_node_obj = NULL;
hnode->hnode_mgr = NULL; hnode->hnode_mgr = NULL;
......
...@@ -834,16 +834,9 @@ static int delete_strm(struct strm_object *stream_obj) ...@@ -834,16 +834,9 @@ static int delete_strm(struct strm_object *stream_obj)
* is invalid. */ * is invalid. */
status = (*intf_fxns->pfn_chnl_close) status = (*intf_fxns->pfn_chnl_close)
(stream_obj->chnl_obj); (stream_obj->chnl_obj);
/* Free all SM address translator resources */
if (!status) {
if (stream_obj->xlator) {
/* force free */
(void)cmm_xlator_delete(stream_obj->
xlator,
true);
}
}
} }
/* Free all SM address translator resources */
kfree(stream_obj->xlator);
kfree(stream_obj); kfree(stream_obj);
} else { } else {
status = -EFAULT; status = -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment