• Home
  • Raw
  • Download

Lines Matching refs:opts

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