Lines Matching refs:opts

865 	struct f_hid_opts *opts = to_f_hid_opts(item);  in hid_attr_release()  local
867 usb_put_function_instance(&opts->func_inst); in hid_attr_release()
877 struct f_hid_opts *opts = to_f_hid_opts(item); \
880 mutex_lock(&opts->lock); \
881 result = sprintf(page, "%d\n", opts->name); \
882 mutex_unlock(&opts->lock); \
890 struct f_hid_opts *opts = to_f_hid_opts(item); \
894 mutex_lock(&opts->lock); \
895 if (opts->refcnt) { \
908 opts->name = num; \
912 mutex_unlock(&opts->lock); \
924 struct f_hid_opts *opts = to_f_hid_opts(item); in f_hid_opts_report_desc_show() local
927 mutex_lock(&opts->lock); in f_hid_opts_report_desc_show()
928 result = opts->report_desc_length; in f_hid_opts_report_desc_show()
929 memcpy(page, opts->report_desc, opts->report_desc_length); in f_hid_opts_report_desc_show()
930 mutex_unlock(&opts->lock); in f_hid_opts_report_desc_show()
938 struct f_hid_opts *opts = to_f_hid_opts(item); in f_hid_opts_report_desc_store() local
942 mutex_lock(&opts->lock); in f_hid_opts_report_desc_store()
944 if (opts->refcnt) in f_hid_opts_report_desc_store()
955 kfree(opts->report_desc); in f_hid_opts_report_desc_store()
956 opts->report_desc = d; in f_hid_opts_report_desc_store()
957 opts->report_desc_length = len; in f_hid_opts_report_desc_store()
958 opts->report_desc_alloc = true; in f_hid_opts_report_desc_store()
961 mutex_unlock(&opts->lock); in f_hid_opts_report_desc_store()
969 struct f_hid_opts *opts = to_f_hid_opts(item); in f_hid_opts_dev_show() local
971 return sprintf(page, "%d:%d\n", major, opts->minor); in f_hid_opts_dev_show()
998 struct f_hid_opts *opts; in hidg_free_inst() local
1000 opts = container_of(f, struct f_hid_opts, func_inst); in hidg_free_inst()
1004 hidg_put_minor(opts->minor); in hidg_free_inst()
1010 if (opts->report_desc_alloc) in hidg_free_inst()
1011 kfree(opts->report_desc); in hidg_free_inst()
1013 kfree(opts); in hidg_free_inst()
1018 struct f_hid_opts *opts; in hidg_alloc_inst() local
1022 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in hidg_alloc_inst()
1023 if (!opts) in hidg_alloc_inst()
1025 mutex_init(&opts->lock); in hidg_alloc_inst()
1026 opts->func_inst.free_func_inst = hidg_free_inst; in hidg_alloc_inst()
1027 ret = &opts->func_inst; in hidg_alloc_inst()
1035 kfree(opts); in hidg_alloc_inst()
1040 opts->minor = hidg_get_minor(); in hidg_alloc_inst()
1041 if (opts->minor < 0) { in hidg_alloc_inst()
1042 ret = ERR_PTR(opts->minor); in hidg_alloc_inst()
1043 kfree(opts); in hidg_alloc_inst()
1048 config_group_init_type_name(&opts->func_inst.group, "", &hid_func_type); in hidg_alloc_inst()
1058 struct f_hid_opts *opts; in hidg_free() local
1061 opts = container_of(f->fi, struct f_hid_opts, func_inst); in hidg_free()
1064 mutex_lock(&opts->lock); in hidg_free()
1065 --opts->refcnt; in hidg_free()
1066 mutex_unlock(&opts->lock); in hidg_free()
1082 struct f_hid_opts *opts; in hidg_alloc() local
1089 opts = container_of(fi, struct f_hid_opts, func_inst); in hidg_alloc()
1091 mutex_lock(&opts->lock); in hidg_alloc()
1092 ++opts->refcnt; in hidg_alloc()
1094 hidg->minor = opts->minor; in hidg_alloc()
1095 hidg->bInterfaceSubClass = opts->subclass; in hidg_alloc()
1096 hidg->bInterfaceProtocol = opts->protocol; in hidg_alloc()
1097 hidg->report_length = opts->report_length; in hidg_alloc()
1098 hidg->report_desc_length = opts->report_desc_length; in hidg_alloc()
1099 if (opts->report_desc) { in hidg_alloc()
1100 hidg->report_desc = kmemdup(opts->report_desc, in hidg_alloc()
1101 opts->report_desc_length, in hidg_alloc()
1105 mutex_unlock(&opts->lock); in hidg_alloc()
1110 mutex_unlock(&opts->lock); in hidg_alloc()