Lines Matching defs:opts

1045 	struct f_hid_opts *opts = to_f_hid_opts(item);
1047 usb_put_function_instance(&opts->func_inst);
1057 struct f_hid_opts *opts = to_f_hid_opts(item); \
1060 mutex_lock(&opts->lock); \
1061 result = sprintf(page, "%d\n", opts->name); \
1062 mutex_unlock(&opts->lock); \
1070 struct f_hid_opts *opts = to_f_hid_opts(item); \
1074 mutex_lock(&opts->lock); \
1075 if (opts->refcnt) { \
1088 opts->name = num; \
1092 mutex_unlock(&opts->lock); \
1105 struct f_hid_opts *opts = to_f_hid_opts(item);
1108 mutex_lock(&opts->lock);
1109 result = opts->report_desc_length;
1110 memcpy(page, opts->report_desc, opts->report_desc_length);
1111 mutex_unlock(&opts->lock);
1119 struct f_hid_opts *opts = to_f_hid_opts(item);
1123 mutex_lock(&opts->lock);
1125 if (opts->refcnt)
1136 kfree(opts->report_desc);
1137 opts->report_desc = d;
1138 opts->report_desc_length = len;
1139 opts->report_desc_alloc = true;
1142 mutex_unlock(&opts->lock);
1150 struct f_hid_opts *opts = to_f_hid_opts(item);
1152 return sprintf(page, "%d:%d\n", major, opts->minor);
1180 struct f_hid_opts *opts;
1182 opts = container_of(f, struct f_hid_opts, func_inst);
1186 hidg_put_minor(opts->minor);
1192 if (opts->report_desc_alloc)
1193 kfree(opts->report_desc);
1195 kfree(opts);
1200 struct f_hid_opts *opts;
1204 opts = kzalloc(sizeof(*opts), GFP_KERNEL);
1205 if (!opts)
1207 mutex_init(&opts->lock);
1208 opts->func_inst.free_func_inst = hidg_free_inst;
1209 ret = &opts->func_inst;
1217 kfree(opts);
1222 opts->minor = hidg_get_minor();
1223 if (opts->minor < 0) {
1224 ret = ERR_PTR(opts->minor);
1225 kfree(opts);
1230 config_group_init_type_name(&opts->func_inst.group, "", &hid_func_type);
1240 struct f_hid_opts *opts;
1243 opts = container_of(f->fi, struct f_hid_opts, func_inst);
1245 mutex_lock(&opts->lock);
1246 --opts->refcnt;
1247 mutex_unlock(&opts->lock);
1262 struct f_hid_opts *opts;
1270 opts = container_of(fi, struct f_hid_opts, func_inst);
1272 mutex_lock(&opts->lock);
1273 ++opts->refcnt;
1278 hidg->dev.devt = MKDEV(major, opts->minor);
1279 ret = dev_set_name(&hidg->dev, "hidg%d", opts->minor);
1281 --opts->refcnt;
1282 mutex_unlock(&opts->lock);
1286 hidg->bInterfaceSubClass = opts->subclass;
1287 hidg->bInterfaceProtocol = opts->protocol;
1288 hidg->report_length = opts->report_length;
1289 hidg->report_desc_length = opts->report_desc_length;
1290 if (opts->report_desc) {
1291 hidg->report_desc = kmemdup(opts->report_desc,
1292 opts->report_desc_length,
1296 --opts->refcnt;
1297 mutex_unlock(&opts->lock);
1301 hidg->use_out_ep = !opts->no_out_endpoint;
1303 mutex_unlock(&opts->lock);