Lines Matching refs:opts
573 struct f_eem_opts *opts; in eem_free_inst() local
575 opts = container_of(f, struct f_eem_opts, func_inst); in eem_free_inst()
576 if (opts->bound) in eem_free_inst()
577 gether_cleanup(netdev_priv(opts->net)); in eem_free_inst()
579 free_netdev(opts->net); in eem_free_inst()
580 kfree(opts); in eem_free_inst()
585 struct f_eem_opts *opts; in eem_alloc_inst() local
587 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in eem_alloc_inst()
588 if (!opts) in eem_alloc_inst()
590 mutex_init(&opts->lock); in eem_alloc_inst()
591 opts->func_inst.free_func_inst = eem_free_inst; in eem_alloc_inst()
592 opts->net = gether_setup_default(); in eem_alloc_inst()
593 if (IS_ERR(opts->net)) { in eem_alloc_inst()
594 struct net_device *net = opts->net; in eem_alloc_inst()
595 kfree(opts); in eem_alloc_inst()
599 config_group_init_type_name(&opts->func_inst.group, "", &eem_func_type); in eem_alloc_inst()
601 return &opts->func_inst; in eem_alloc_inst()
607 struct f_eem_opts *opts; in eem_free() local
610 opts = container_of(f->fi, struct f_eem_opts, func_inst); in eem_free()
612 mutex_lock(&opts->lock); in eem_free()
613 opts->refcnt--; in eem_free()
614 mutex_unlock(&opts->lock); in eem_free()
627 struct f_eem_opts *opts; in eem_alloc() local
634 opts = container_of(fi, struct f_eem_opts, func_inst); in eem_alloc()
635 mutex_lock(&opts->lock); in eem_alloc()
636 opts->refcnt++; in eem_alloc()
638 eem->port.ioport = netdev_priv(opts->net); in eem_alloc()
639 mutex_unlock(&opts->lock); in eem_alloc()