if (ret < 0) {
_E("Cannot get the pass '%s' resource (%d)\n",
cdata->res_name, ret);
+
+ res->state = PASS_UNUSED;
continue;
}
if (ret < 0)
_E("Cannot put the pass '%s' resource (%d)\n",
cdata->res_name, ret);
+
+ res->state = PASS_UNUSED;
continue;
}
if (ret < 0)
_E("Cannot put the pass '%s' resource (%d)\n",
cdata->res_name, ret);
+
+ res->state = PASS_UNUSED;
+ continue;
}
+
+ res->state = PASS_ON;
}
return 0;
struct pass_resource *res = &g_pass.res[i];
struct pass_conf_data *cdata = &g_pass.res[i].cdata;
+ if (res->state == PASS_UNUSED)
+ continue;
+
ret = pass_exit_resource(res);
if (ret < 0)
_E("Cannot exit the pass '%s' resource (%d)\n",
_E("Cannot put the pass '%s' resource (%d)\n",
cdata->res_name, ret);
}
+
+ res->state = PASS_OFF;
}
pass_put_resource_config(&g_pass);
/*
* struct pass_resource - Represent the each h/w resource.
*
+ * @state: represents the state of the corresponding resource.
* @cdata: the parsed data from configuration file (pass.conf).
* @hal: the hal instance of each h/w resource from pass_get_hal_info().
* - If res_type of cdata is PASS_RESOURCE_CPU_ID, hal.cpu will be used.
* @initdata: the initial data to restore when pass service is stopped
*/
struct pass_resource {
+ enum pass_state state;
struct pass_conf_data cdata;
struct pass_policy policy;
struct pass_resource_initdata initdata;