Esempio n. 1
0
/*
 *  ======== SERVICES_Exit ========
 *  Purpose:
 *      Discontinue usage of module; free resources when reference count
 *      reaches 0.
 */
void SERVICES_Exit(void)
{
	DBC_Require(cRefs > 0);

	GT_1trace(SERVICES_debugMask, GT_5CLASS, "SERVICES_Exit: cRefs 0x%x\n",
		 cRefs);

	cRefs--;
	if (cRefs == 0) {
		/* Uninitialize all SERVICES modules here */
		NTFY_Exit();
		SYNC_Exit();
		CLK_Exit();
		REG_Exit();
		LST_Exit();
		KFILE_Exit();
		DPC_Exit();
		DBG_Exit();
		CSL_Exit();
		CFG_Exit();
		MEM_Exit();

		GT_exit();
	}

	DBC_Ensure(cRefs >= 0);
}
static int __devexit omap34xx_bridge_remove(struct platform_device *pdev)
{
	dev_t devno;
	bool ret;
	DSP_STATUS dsp_status = DSP_SOK;
	HANDLE hDrvObject = NULL;

	dsp_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT);
	if (DSP_FAILED(dsp_status))
		goto func_cont;

#ifdef CONFIG_BRIDGE_DVFS
	if (clk_notifier_unregister(clk_handle, &iva_clk_notifier))
		pr_err("%s: clk_notifier_unregister failed for iva2_ck\n",
								__func__);
#endif /* #ifdef CONFIG_BRIDGE_DVFS */

	if (driverContext) {
		/* Put the DSP in reset state */
		ret = DSP_Deinit(driverContext);
		driverContext = 0;
		DBC_Assert(ret == true);
	}

#ifdef CONFIG_BRIDGE_DVFS
	clk_put(clk_handle);
	clk_handle = NULL;
#endif

func_cont:

#ifdef CONFIG_PM
	/* The suspend wait queue should not have anything waiting on it
	   since remove won't be called while the file is open */
	DBC_Assert(!waitqueue_active(&bridge_suspend_data.suspend_wq));
#endif
	MEM_ExtPhysPoolRelease();

	SERVICES_Exit();
	GT_exit();

	/* Remove driver sysfs entries */
	bridge_destroy_sysfs();

	devno = MKDEV(driver_major, 0);
	cdev_del(&bridge_cdev);
	unregister_chrdev_region(devno, 1);
	if (bridge_class) {
		/* remove the device from sysfs */
		device_destroy(bridge_class, MKDEV(driver_major, 0));
		class_destroy(bridge_class);

	}
	return 0;
}
/*
 *  ======== _ACPY3_exit ========
 *  Finalize the ACPY3 module
 */
static Void _ACPY3_exit(Void)
{
    GT_0trace(ti_sdo_fc_acpy3_GTMask, GT_ENTER, "_ACPY3_exit > Enter\n");

    refCount--;

    if (refCount == 0) {
        GT_exit();
    }

    GT_0trace(ti_sdo_fc_acpy3_GTMask, GT_ENTER, "_ACPY3_exit > Enter\n");
}
Esempio n. 4
0
/*
 *  ======== SERVICES_Exit ========
 *  Purpose:
 *      Discontinue usage of module; free resources when reference count
 *      reaches 0.
 */
void SERVICES_Exit(void)
{
	/* Uninitialize all SERVICES modules here */
	NTFY_Exit();
	SYNC_Exit();
	CLK_Exit();
	REG_Exit();
	DBG_Exit();
	CFG_Exit();
	MEM_Exit();

	GT_exit();
}
/*
 *  ======== _ACPY3_exit ========
 *  Finalize the ACPY3 module
 */
static Void _ACPY3_exit(Void)
{
    GT_0trace(CURTRACE, GT_ENTER, "_ACPY3_exit > Enter\n");

    refCount--;

    if (refCount == 0) {
#ifndef _ACPY3_CPUCOPY_
        if (_ACPY3_lock != NULL) {
            LockMP_delete(_ACPY3_lock);
            _ACPY3_lock = NULL;
        }
#endif
        GT_exit();
    }

    GT_0trace(CURTRACE, GT_ENTER, "_ACPY3_exit > Enter\n");
}
/*
 *  ======== IRESMAN_MEMTCM_exit ========
 *  Function called when RESMAN is no longer needed. Use it to free memory 
 *  allocated etc
 */
IRES_Status IRESMAN_MEMTCM_exit() 
{
    /*
     * Check if initialized
     */
    GT_0trace(CURTRACE, GT_ENTER, 
            "IRESMAN_MEMTCM_exit> Enter \n"); 

    if (!(_initialized)) {

        GT_0trace(CURTRACE, GT_ENTER, 
                "IRESMAN_MEMTCM_exit> Exit (status=IRES_ENOINIT)\n"); 

        return (IRES_ENOINIT);
    }

    freeInternalState();

    SMGRMP_delete(_MEMTCM_lock, smgr); 

    smgr = NULL;

    LockMP_delete(_MEMTCM_lock);

    _MEMTCM_lock = NULL;

    /*
     * Free up any memory that might be allocated in this module
     * Basically memory that has been used by the protocol implementation
     */

    /*
     * Set the initialized flag to zero again
     */
    _initialized = 0;

    GT_0trace(CURTRACE, GT_ENTER, 
            "IRESMAN_MEMTCM_exit> Exit (status=IRES_OK)\n"); 

    GT_exit();

    return (IRES_OK);
}