Lines Matching refs:opts

1049 	struct f_hid_opts *opts = to_f_hid_opts(item);
1051 usb_put_function_instance(&opts->func_inst);
1061 struct f_hid_opts *opts = to_f_hid_opts(item); \
1064 mutex_lock(&opts->lock); \
1065 result = sprintf(page, "%d\n", opts->name); \
1066 mutex_unlock(&opts->lock); \
1074 struct f_hid_opts *opts = to_f_hid_opts(item); \
1078 mutex_lock(&opts->lock); \
1079 if (opts->refcnt) { \
1092 opts->name = num; \
1096 mutex_unlock(&opts->lock); \
1109 struct f_hid_opts *opts = to_f_hid_opts(item);
1112 mutex_lock(&opts->lock);
1113 result = opts->report_desc_length;
1114 memcpy(page, opts->report_desc, opts->report_desc_length);
1115 mutex_unlock(&opts->lock);
1123 struct f_hid_opts *opts = to_f_hid_opts(item);
1127 mutex_lock(&opts->lock);
1129 if (opts->refcnt)
1140 kfree(opts->report_desc);
1141 opts->report_desc = d;
1142 opts->report_desc_length = len;
1143 opts->report_desc_alloc = true;
1146 mutex_unlock(&opts->lock);
1154 struct f_hid_opts *opts = to_f_hid_opts(item);
1156 return sprintf(page, "%d:%d\n", major, opts->minor);
1184 struct f_hid_opts *opts;
1186 opts = container_of(f, struct f_hid_opts, func_inst);
1190 hidg_put_minor(opts->minor);
1196 if (opts->report_desc_alloc)
1197 kfree(opts->report_desc);
1199 kfree(opts);
1204 struct f_hid_opts *opts;
1208 opts = kzalloc(sizeof(*opts), GFP_KERNEL);
1209 if (!opts)
1211 mutex_init(&opts->lock);
1212 opts->func_inst.free_func_inst = hidg_free_inst;
1213 ret = &opts->func_inst;
1221 kfree(opts);
1226 opts->minor = hidg_get_minor();
1227 if (opts->minor < 0) {
1228 ret = ERR_PTR(opts->minor);
1229 kfree(opts);
1234 config_group_init_type_name(&opts->func_inst.group, "", &hid_func_type);
1244 struct f_hid_opts *opts;
1247 opts = container_of(f->fi, struct f_hid_opts, func_inst);
1249 mutex_lock(&opts->lock);
1250 --opts->refcnt;
1251 mutex_unlock(&opts->lock);
1266 struct f_hid_opts *opts;
1274 opts = container_of(fi, struct f_hid_opts, func_inst);
1276 mutex_lock(&opts->lock);
1281 hidg->dev.devt = MKDEV(major, opts->minor);
1282 ret = dev_set_name(&hidg->dev, "hidg%d", opts->minor);
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,
1299 hidg->use_out_ep = !opts->no_out_endpoint;
1301 ++opts->refcnt;
1302 mutex_unlock(&opts->lock);
1320 mutex_unlock(&opts->lock);