}
}
+ /* Add resource_device according to h/w resource information */
+ res->device = calloc(1, sizeof(*res->device));
+ if (!res->device) {
+ ret = -ENOMEM;
+ goto err_res_dev;
+ }
+
+ res->device->name = res->config_data.res_name;
+ res->device->type = res->config_data.res_type;
+
+ ret = add_resource_device(res->device);
+ if (ret < 0) {
+ _E("cannot add resource device (res_name:%s, res_type%d)",
+ res->config_data.res_name,
+ res->config_data.res_type);
+ goto err;
+ }
+
return 0;
+err:
+ free(res->device);
+err_res_dev:
+ if (is_supported_module(res, PASS_MODULE_THERMAL))
+ if (pass_thermal_exit(res) < 0)
+ _E("cannot exit PASS Thermal");
err_thermal:
if (is_supported_module(res, PASS_MODULE_PMQOS))
if (pass_pmqos_exit(res) < 0)
{
int ret;
+ /* Remove resource_device */
+ remove_resource_device(res->device);
+ free(res->device);
+ res->device = NULL;
+
/* Put configuration of each resource from pass-resource*.conf */
pass_parser_put_each_resource_config(res);
#include <util/common.h>
#include <util/log.h>
+#include <util/resource.h>
#define PASS_LEVEL_COND_MAX 3
struct pass_pmqos pmqos;
/** Instance of PASS_MODULE_THERMAL module */
struct pass_thermal thermal;
+
+ /** Instance of resouce device containing h/w resource information */
+ struct resource_device *device;
};
/******************************************************