[PATCH 12/14] DSPBRIDGE: Remove all resources on driver exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Omar Ramirez Luna <omar.ramirez@xxxxxx>

There is no need to walk the process context list
on exit, remove all process instead without exception.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@xxxxxx>
---
 drivers/dsp/bridge/rmgr/drv_interface.c |   32 +++++-------------------------
 1 files changed, 6 insertions(+), 26 deletions(-)
 mode change 100755 => 100644 drivers/dsp/bridge/rmgr/drv_interface.c

diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c
old mode 100755
new mode 100644
index e937766..d17d3cf
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -451,44 +451,24 @@ static int __devexit omap34xx_bridge_remove(struct platform_device *pdev)
 	HANDLE	     hDrvObject = NULL;
 	struct PROCESS_CONTEXT	*pTmp = NULL;
 	struct PROCESS_CONTEXT    *pCtxtclosed = NULL;
-	struct PROCESS_CONTEXT    *pCtxttraverse = NULL;
 
 	GT_0trace(driverTrace, GT_ENTER, "-> driver_exit\n");
 
 	dsp_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT);
+	if (DSP_FAILED(dsp_status))
+		goto func_cont;
 	DRV_GetProcCtxtList(&pCtxtclosed, (struct DRV_OBJECT *)hDrvObject);
 	while (pCtxtclosed != NULL) {
+		GT_1trace(driverTrace, GT_5CLASS, "***Cleanup of "
+			 "process***%d\n", pCtxtclosed->pid);
 		DRV_RemoveAllResources(pCtxtclosed);
-		if (pCtxtclosed->hProcessor != NULL) {
-			DRV_GetProcCtxtList(&pCtxttraverse,
-					    (struct DRV_OBJECT *)hDrvObject);
-			if (pCtxttraverse->next == NULL) {
-				PROC_Detach(pCtxtclosed->hProcessor);
-				goto func_cont;
-			}
-			if ((pCtxtclosed->pid == pCtxttraverse->pid) &&
-			   (pCtxttraverse->next != NULL)) {
-				pCtxttraverse =	pCtxttraverse->next;
-			}
-			while ((pCtxttraverse != NULL) &&
-			      (pCtxtclosed->hProcessor
-			      != pCtxttraverse->hProcessor)) {
-				pCtxttraverse =	pCtxttraverse->next;
-				if ((pCtxttraverse != NULL) &&
-				   (pCtxtclosed->pid == pCtxttraverse->pid)) {
-					pCtxttraverse = pCtxttraverse->next;
-				}
-			}
-			if (pCtxttraverse == NULL)
-				PROC_Detach(pCtxtclosed->hProcessor);
-		}
-func_cont:
+		PROC_Detach(pCtxtclosed->hProcessor);
 		pTmp = pCtxtclosed->next;
 		DRV_RemoveProcContext((struct DRV_OBJECT *)hDrvObject,
 				     pCtxtclosed, (void *)pCtxtclosed->pid);
 		pCtxtclosed = pTmp;
 	}
-
+func_cont:
 	/* unregister the clock notifier */
 #ifdef CONFIG_BRIDGE_DVFS
 	if (!clk_notifier_unregister(clk_handle, &iva_clk_notifier)) {
-- 
1.6.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux