Lines Matching refs:opts
594 struct f_eem_opts *opts; in eem_free_inst() local
596 opts = container_of(f, struct f_eem_opts, func_inst); in eem_free_inst()
597 if (opts->bound) in eem_free_inst()
598 gether_cleanup(netdev_priv(opts->net)); in eem_free_inst()
600 free_netdev(opts->net); in eem_free_inst()
601 kfree(opts); in eem_free_inst()
606 struct f_eem_opts *opts; in eem_alloc_inst() local
608 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in eem_alloc_inst()
609 if (!opts) in eem_alloc_inst()
611 mutex_init(&opts->lock); in eem_alloc_inst()
612 opts->func_inst.free_func_inst = eem_free_inst; in eem_alloc_inst()
613 opts->net = gether_setup_default(); in eem_alloc_inst()
614 if (IS_ERR(opts->net)) { in eem_alloc_inst()
615 struct net_device *net = opts->net; in eem_alloc_inst()
616 kfree(opts); in eem_alloc_inst()
620 config_group_init_type_name(&opts->func_inst.group, "", &eem_func_type); in eem_alloc_inst()
622 return &opts->func_inst; in eem_alloc_inst()
628 struct f_eem_opts *opts; in eem_free() local
631 opts = container_of(f->fi, struct f_eem_opts, func_inst); in eem_free()
633 mutex_lock(&opts->lock); in eem_free()
634 opts->refcnt--; in eem_free()
635 mutex_unlock(&opts->lock); in eem_free()
648 struct f_eem_opts *opts; in eem_alloc() local
655 opts = container_of(fi, struct f_eem_opts, func_inst); in eem_alloc()
656 mutex_lock(&opts->lock); in eem_alloc()
657 opts->refcnt++; in eem_alloc()
659 eem->port.ioport = netdev_priv(opts->net); in eem_alloc()
660 mutex_unlock(&opts->lock); in eem_alloc()