Lines Matching refs:opts
1327 struct f_hid_opts *opts = to_f_hid_opts(item); in hid_attr_release() local
1329 usb_put_function_instance(&opts->func_inst); in hid_attr_release()
1339 struct f_hid_opts *opts = to_f_hid_opts(item); \
1342 mutex_lock(&opts->lock); \
1343 result = sprintf(page, "%d\n", opts->name); \
1344 mutex_unlock(&opts->lock); \
1352 struct f_hid_opts *opts = to_f_hid_opts(item); \
1356 mutex_lock(&opts->lock); \
1357 if (opts->refcnt) { \
1370 opts->name = num; \
1374 mutex_unlock(&opts->lock); \
1387 struct f_hid_opts *opts = to_f_hid_opts(item); in f_hid_opts_report_desc_show() local
1390 mutex_lock(&opts->lock); in f_hid_opts_report_desc_show()
1391 result = opts->report_desc_length; in f_hid_opts_report_desc_show()
1392 memcpy(page, opts->report_desc, opts->report_desc_length); in f_hid_opts_report_desc_show()
1393 mutex_unlock(&opts->lock); in f_hid_opts_report_desc_show()
1401 struct f_hid_opts *opts = to_f_hid_opts(item); in f_hid_opts_report_desc_store() local
1405 mutex_lock(&opts->lock); in f_hid_opts_report_desc_store()
1407 if (opts->refcnt) in f_hid_opts_report_desc_store()
1418 kfree(opts->report_desc); in f_hid_opts_report_desc_store()
1419 opts->report_desc = d; in f_hid_opts_report_desc_store()
1420 opts->report_desc_length = len; in f_hid_opts_report_desc_store()
1421 opts->report_desc_alloc = true; in f_hid_opts_report_desc_store()
1424 mutex_unlock(&opts->lock); in f_hid_opts_report_desc_store()
1432 struct f_hid_opts *opts = to_f_hid_opts(item); in f_hid_opts_interval_show() local
1435 mutex_lock(&opts->lock); in f_hid_opts_interval_show()
1436 result = sprintf(page, "%d\n", opts->interval); in f_hid_opts_interval_show()
1437 mutex_unlock(&opts->lock); in f_hid_opts_interval_show()
1445 struct f_hid_opts *opts = to_f_hid_opts(item); in f_hid_opts_interval_store() local
1449 mutex_lock(&opts->lock); in f_hid_opts_interval_store()
1450 if (opts->refcnt) { in f_hid_opts_interval_store()
1466 opts->interval = (unsigned char)tmp; in f_hid_opts_interval_store()
1467 opts->interval_user_set = true; in f_hid_opts_interval_store()
1471 mutex_unlock(&opts->lock); in f_hid_opts_interval_store()
1479 struct f_hid_opts *opts = to_f_hid_opts(item); in f_hid_opts_dev_show() local
1481 return sprintf(page, "%d:%d\n", major, opts->minor); in f_hid_opts_dev_show()
1510 struct f_hid_opts *opts; in hidg_free_inst() local
1512 opts = container_of(f, struct f_hid_opts, func_inst); in hidg_free_inst()
1516 hidg_put_minor(opts->minor); in hidg_free_inst()
1522 if (opts->report_desc_alloc) in hidg_free_inst()
1523 kfree(opts->report_desc); in hidg_free_inst()
1525 kfree(opts); in hidg_free_inst()
1530 struct f_hid_opts *opts; in hidg_alloc_inst() local
1534 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in hidg_alloc_inst()
1535 if (!opts) in hidg_alloc_inst()
1537 mutex_init(&opts->lock); in hidg_alloc_inst()
1539 opts->interval = 4; in hidg_alloc_inst()
1540 opts->interval_user_set = false; in hidg_alloc_inst()
1542 opts->func_inst.free_func_inst = hidg_free_inst; in hidg_alloc_inst()
1543 ret = &opts->func_inst; in hidg_alloc_inst()
1551 kfree(opts); in hidg_alloc_inst()
1556 opts->minor = hidg_get_minor(); in hidg_alloc_inst()
1557 if (opts->minor < 0) { in hidg_alloc_inst()
1558 ret = ERR_PTR(opts->minor); in hidg_alloc_inst()
1559 kfree(opts); in hidg_alloc_inst()
1564 config_group_init_type_name(&opts->func_inst.group, "", &hid_func_type); in hidg_alloc_inst()
1574 struct f_hid_opts *opts; in hidg_free() local
1577 opts = container_of(f->fi, struct f_hid_opts, func_inst); in hidg_free()
1579 mutex_lock(&opts->lock); in hidg_free()
1580 --opts->refcnt; in hidg_free()
1581 mutex_unlock(&opts->lock); in hidg_free()
1596 struct f_hid_opts *opts; in hidg_alloc() local
1604 opts = container_of(fi, struct f_hid_opts, func_inst); in hidg_alloc()
1606 mutex_lock(&opts->lock); in hidg_alloc()
1611 hidg->dev.devt = MKDEV(major, opts->minor); in hidg_alloc()
1612 ret = dev_set_name(&hidg->dev, "hidg%d", opts->minor); in hidg_alloc()
1616 hidg->bInterfaceSubClass = opts->subclass; in hidg_alloc()
1617 hidg->bInterfaceProtocol = opts->protocol; in hidg_alloc()
1618 hidg->report_length = opts->report_length; in hidg_alloc()
1619 hidg->report_desc_length = opts->report_desc_length; in hidg_alloc()
1620 hidg->interval = opts->interval; in hidg_alloc()
1621 hidg->interval_user_set = opts->interval_user_set; in hidg_alloc()
1622 if (opts->report_desc) { in hidg_alloc()
1623 hidg->report_desc = kmemdup(opts->report_desc, in hidg_alloc()
1624 opts->report_desc_length, in hidg_alloc()
1631 hidg->use_out_ep = !opts->no_out_endpoint; in hidg_alloc()
1633 ++opts->refcnt; in hidg_alloc()
1634 mutex_unlock(&opts->lock); in hidg_alloc()
1652 mutex_unlock(&opts->lock); in hidg_alloc()