Lines Matching refs:config

163 static void free_config_instance(struct config_instance *config){  in free_config_instance()  argument
165 if (config) { in free_config_instance()
166 if (config->fields) { in free_config_instance()
167 free(config->fields[0].data); in free_config_instance()
168 free(config->fields[0].field_name); in free_config_instance()
169 free(config->fields); in free_config_instance()
171 free(config->algo_type); in free_config_instance()
172 free(config->cfg_desc); in free_config_instance()
173 free(config); in free_config_instance()
182 … struct config_instance *config = (struct config_instance *)malloc(sizeof(struct config_instance)); in allocate_config_instance() local
183 if (!config) { in allocate_config_instance()
187 memset(config, 0, sizeof(*config)); in allocate_config_instance()
189 config->cfg_desc = (char *)malloc(sizeof(char) * max_string_size); in allocate_config_instance()
190 if (!config->cfg_desc) { in allocate_config_instance()
191 free_config_instance(config); in allocate_config_instance()
195 memset(config->cfg_desc, 0, sizeof(char)*max_string_size); in allocate_config_instance()
197 config->algo_type = (char *)malloc(sizeof(char) * max_string_size); in allocate_config_instance()
198 if (!config->algo_type) { in allocate_config_instance()
199 free_config_instance(config); in allocate_config_instance()
203 memset(config->algo_type, 0, sizeof(char) * max_string_size); in allocate_config_instance()
205 config->fields = (struct field_data *)malloc(sizeof(struct field_data)); in allocate_config_instance()
206 if (!config->fields) { in allocate_config_instance()
207 free_config_instance(config); in allocate_config_instance()
211 memset(config->fields, 0, sizeof(*config->fields)); in allocate_config_instance()
213 config->fields[0].field_name = (char*)malloc(sizeof(char) * max_string_size); in allocate_config_instance()
214 if (!config->fields[0].field_name) { in allocate_config_instance()
215 free_config_instance(config); in allocate_config_instance()
219 memset(config->fields[0].field_name, 0, sizeof(char) * max_string_size); in allocate_config_instance()
221 config->fields[0].data = (void*)malloc(sizeof(int)); in allocate_config_instance()
222 if (!config->fields[0].data) { in allocate_config_instance()
223 free_config_instance(config); in allocate_config_instance()
228 return config; in allocate_config_instance()
241 struct config_instance *config = allocate_config_instance(); in disable_config() local
242 if (!config) { in disable_config()
245 strlcpy(config->cfg_desc, config_name, max_string_size); in disable_config()
246 strlcpy(config->algo_type, algo_type, max_string_size); in disable_config()
247 strlcpy(config->fields[0].field_name, "disable", max_string_size); in disable_config()
249 config->fields_mask |= DISABLE_FIELD; in disable_config()
250 config->num_fields = 1; in disable_config()
251 config->fields[0].data_type = FIELD_INT; in disable_config()
252 config->fields[0].num_data = 1; in disable_config()
253 *(int*)(config->fields[0].data) = 1; //DISABLE in disable_config()
256 result = (*p_thermal_client_config_set)(config, 1); in disable_config()
260 free_config_instance(config); in disable_config()
275 struct config_instance *config = allocate_config_instance(); in enable_config() local
276 if (!config) { in enable_config()
279 strlcpy(config->cfg_desc, config_name, max_string_size); in enable_config()
280 strlcpy(config->algo_type, algo_type, max_string_size); in enable_config()
281 strlcpy(config->fields[0].field_name, "disable", max_string_size); in enable_config()
283 config->fields_mask |= DISABLE_FIELD; in enable_config()
284 config->num_fields = 1; in enable_config()
285 config->fields[0].data_type = FIELD_INT; in enable_config()
286 config->fields[0].num_data = 1; in enable_config()
287 *(int*)(config->fields[0].data) = 0; //ENABLE in enable_config()
289 result = (*p_thermal_client_config_set)(config, 1); in enable_config()
295 free_config_instance(config); in enable_config()