/* is called from OS specific driver exit point */
void mali_kernel_destructor( void )
{
	MALI_DEBUG_PRINT(2, ("\n"));
	MALI_DEBUG_PRINT(2, ("Unloading Mali v%d device driver.\n",_MALI_API_VERSION));
#if USING_MALI_PMM
	malipmm_force_powerup();
#endif
	terminate_subsystems(); /* subsystems are responsible for their registered resources */
    _mali_osk_term();

	if (_MALI_OSK_ERR_OK != mali_platform_deinit())
	{
		MALI_PRINT(("Failed to deinit platform\n"));
	}
	MALI_DEBUG_PRINT(2, ("Module unloaded.\n"));
}
void mali_driver_exit(void)
{
#if USING_MALI_PMM
	malipmm_force_powerup();
#endif
	mali_kernel_destructor();

#if USING_MALI_PMM
	malipmm_force_powerdown();
#endif

#if USING_MALI_PMM
#if MALI_LICENSE_IS_GPL
#ifdef CONFIG_PM
	_mali_dev_platform_unregister();
#endif
#endif
#endif
}