Lines Matching refs:opts

411 	struct f_gether_opts *opts;  in geth_free_inst()  local
413 opts = container_of(f, struct f_gether_opts, func_inst); in geth_free_inst()
414 if (device_is_registered(&opts->net->dev)) in geth_free_inst()
415 gether_cleanup(netdev_priv(opts->net)); in geth_free_inst()
417 free_netdev(opts->net); in geth_free_inst()
418 kfree(opts); in geth_free_inst()
423 struct f_gether_opts *opts; in geth_alloc_inst() local
425 opts = kzalloc_obj(*opts); in geth_alloc_inst()
426 if (!opts) in geth_alloc_inst()
428 mutex_init(&opts->lock); in geth_alloc_inst()
429 opts->func_inst.free_func_inst = geth_free_inst; in geth_alloc_inst()
430 opts->net = gether_setup_default(); in geth_alloc_inst()
431 if (IS_ERR(opts->net)) { in geth_alloc_inst()
432 struct net_device *net = opts->net; in geth_alloc_inst()
433 kfree(opts); in geth_alloc_inst()
437 config_group_init_type_name(&opts->func_inst.group, "", in geth_alloc_inst()
440 return &opts->func_inst; in geth_alloc_inst()
446 struct f_gether_opts *opts; in geth_free() local
448 opts = container_of(f->fi, struct f_gether_opts, func_inst); in geth_free()
451 scoped_guard(mutex, &opts->lock) in geth_free()
452 opts->refcnt--; in geth_free()
458 struct f_gether_opts *opts; in geth_unbind() local
460 opts = container_of(f->fi, struct f_gether_opts, func_inst); in geth_unbind()
465 opts->bind_count--; in geth_unbind()
466 if (opts->bind_count == 0 && !opts->bound) in geth_unbind()
467 gether_detach_gadget(opts->net); in geth_unbind()
473 struct f_gether_opts *opts; in geth_alloc() local
481 opts = container_of(fi, struct f_gether_opts, func_inst); in geth_alloc()
483 mutex_lock(&opts->lock); in geth_alloc()
484 opts->refcnt++; in geth_alloc()
486 status = gether_get_host_addr_cdc(opts->net, geth->ethaddr, in geth_alloc()
490 mutex_unlock(&opts->lock); in geth_alloc()
495 geth->port.ioport = netdev_priv(opts->net); in geth_alloc()
496 mutex_unlock(&opts->lock); in geth_alloc()