Lines Matching defs:opts
1348 struct f_tcm_opts *opts;
1363 opts = container_of(tpg_instances[i].func_inst, struct f_tcm_opts,
1365 mutex_lock(&opts->dep_lock);
1366 if (!opts->ready)
1369 if (opts->has_dep) {
1370 if (!try_module_get(opts->dependent))
1375 &opts->func_inst.group.cg_item);
1403 mutex_unlock(&opts->dep_lock);
1412 if (opts->has_dep)
1413 module_put(opts->dependent);
1415 configfs_undepend_item_unlocked(&opts->func_inst.group.cg_item);
1417 mutex_unlock(&opts->dep_lock);
1431 struct f_tcm_opts *opts;
1443 opts = container_of(tpg_instances[i].func_inst,
1445 mutex_lock(&opts->dep_lock);
1446 if (opts->has_dep)
1447 module_put(opts->dependent);
1450 &opts->func_inst.group.cg_item);
1451 mutex_unlock(&opts->dep_lock);
1999 struct f_tcm_opts *opts;
2003 opts = container_of(f->fi, struct f_tcm_opts, func_inst);
2005 mutex_lock(&opts->dep_lock);
2006 if (!opts->can_attach) {
2007 mutex_unlock(&opts->dep_lock);
2010 mutex_unlock(&opts->dep_lock);
2162 struct f_tcm_opts *opts = to_f_tcm_opts(item);
2164 usb_put_function_instance(&opts->func_inst);
2178 struct f_tcm_opts *opts;
2181 opts = container_of(f, struct f_tcm_opts, func_inst);
2191 kfree(opts);
2196 struct f_tcm_opts *opts = container_of(f, struct f_tcm_opts, func_inst);
2198 mutex_lock(&opts->dep_lock);
2199 opts->can_attach = true;
2200 mutex_unlock(&opts->dep_lock);
2207 struct f_tcm_opts *opts = container_of(f, struct f_tcm_opts, func_inst);
2209 mutex_lock(&opts->dep_lock);
2210 unregister_gadget_item(opts->
2212 opts->can_attach = false;
2213 mutex_unlock(&opts->dep_lock);
2219 struct f_tcm_opts *opts = container_of(f, struct f_tcm_opts, func_inst);
2221 if (opts->tcm_register_callback)
2222 return opts->tcm_register_callback(f);
2230 struct f_tcm_opts *opts = container_of(f, struct f_tcm_opts, func_inst);
2232 if (opts->tcm_unregister_callback)
2233 opts->tcm_unregister_callback(f);
2238 struct f_tcm_opts *opts = container_of(f, struct f_tcm_opts, func_inst);
2242 mutex_lock(&opts->dep_lock);
2243 opts->ready = true;
2244 mutex_unlock(&opts->dep_lock);
2251 struct f_tcm_opts *opts;
2255 opts = kzalloc(sizeof(*opts), GFP_KERNEL);
2256 if (!opts)
2266 kfree(opts);
2269 tpg_instances[i].func_inst = &opts->func_inst;
2272 mutex_init(&opts->dep_lock);
2273 opts->func_inst.set_inst_name = tcm_set_name;
2274 opts->func_inst.free_func_inst = tcm_free_inst;
2275 opts->tcm_register_callback = tcm_register_callback;
2276 opts->tcm_unregister_callback = tcm_unregister_callback;
2278 config_group_init_type_name(&opts->func_inst.group, "",
2281 return &opts->func_inst;