From patchwork Thu Sep 30 18:33:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ramos Falcon, Ernesto" X-Patchwork-Id: 220832 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8UIRm6J026328 for ; Thu, 30 Sep 2010 18:27:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754924Ab0I3S1Z (ORCPT ); Thu, 30 Sep 2010 14:27:25 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:52149 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752972Ab0I3S1Y (ORCPT ); Thu, 30 Sep 2010 14:27:24 -0400 Received: from dlep34.itg.ti.com ([157.170.170.115]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o8UIRI68003398 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 30 Sep 2010 13:27:19 -0500 Received: from emcc1.sasken-mty.naucm.ext.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id o8UIRIL3010932; Thu, 30 Sep 2010 13:27:18 -0500 (CDT) Received: from localhost.localdomain (x0076199-desktop.sasken-mty.naucm.ext.ti.com [10.87.230.107]) by emcc1.sasken-mty.naucm.ext.ti.com (8.13.8+Sun/8.13.8) with ESMTP id o8UIRHC3006299; Thu, 30 Sep 2010 13:27:17 -0500 (CDT) From: Ernesto Ramos To: gregkh@suse.de, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ameya.palande@nokia.com, felipe.contreras@gmail.com, andy.shevchenko@gmail.com, Ernesto Ramos , Omar Ramirez Luna Subject: [PATCH] staging:ti dspbridge: remove cmm_xlator_delete wrapper Date: Thu, 30 Sep 2010 13:33:41 -0500 Message-Id: <1285871621-26918-1-git-send-email-ernesto@ti.com> X-Mailer: git-send-email 1.5.4.5 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 30 Sep 2010 18:27:49 +0000 (UTC) diff --git a/drivers/staging/tidspbridge/include/dspbridge/cmm.h b/drivers/staging/tidspbridge/include/dspbridge/cmm.h index a921f1b..6ad313f 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cmm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cmm.h @@ -300,25 +300,6 @@ extern int cmm_xlator_create(struct cmm_xlatorobject **xlator, 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 ======== * Purpose: * Free SM buffer and descriptor. diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c b/drivers/staging/tidspbridge/pmgr/cmm.c index e3f77bd..93a7c4f 100644 --- a/drivers/staging/tidspbridge/pmgr/cmm.c +++ b/drivers/staging/tidspbridge/pmgr/cmm.c @@ -968,23 +968,6 @@ int cmm_xlator_create(struct cmm_xlatorobject **xlator, } /* - * ======== 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 ======== */ void *cmm_xlator_alloc_buf(struct cmm_xlatorobject *xlator, void *va_buf, diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 84882dc..1562f3c 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -2505,7 +2505,6 @@ static void delete_node(struct node_object *hnode, struct process_context *pr_ctxt) { struct node_mgr *hnode_mgr; - struct cmm_xlatorobject *xlator; struct bridge_drv_interface *intf_fxns; u32 i; enum node_type node_type; @@ -2523,7 +2522,7 @@ static void delete_node(struct node_object *hnode, hnode_mgr = hnode->hnode_mgr; if (!hnode_mgr) goto func_end; - xlator = hnode->xlator; + node_type = node_get_type(hnode); if (node_type != NODE_DEVICE) { node_msg_args = hnode->create_args.asa.node_msg_args; @@ -2619,11 +2618,7 @@ static void delete_node(struct node_object *hnode, hnode->dcd_props.obj_data.node_obj.pstr_i_alg_name = NULL; /* Free all SM address translator resources */ - if (xlator) { - (void)cmm_xlator_delete(xlator, true); /* force free */ - xlator = NULL; - } - + kfree(hnode->xlator); kfree(hnode->nldr_node_obj); hnode->nldr_node_obj = NULL; hnode->hnode_mgr = NULL; diff --git a/drivers/staging/tidspbridge/rmgr/strm.c b/drivers/staging/tidspbridge/rmgr/strm.c index f4986b7..2e42714 100644 --- a/drivers/staging/tidspbridge/rmgr/strm.c +++ b/drivers/staging/tidspbridge/rmgr/strm.c @@ -834,16 +834,9 @@ static int delete_strm(struct strm_object *stream_obj) * is invalid. */ status = (*intf_fxns->pfn_chnl_close) (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); } else { status = -EFAULT;