Lines Matching refs:opts
563 struct f_eem_opts *opts; in eem_free_inst() local
565 opts = container_of(f, struct f_eem_opts, func_inst); in eem_free_inst()
566 if (opts->bound) in eem_free_inst()
567 gether_cleanup(netdev_priv(opts->net)); in eem_free_inst()
569 free_netdev(opts->net); in eem_free_inst()
570 kfree(opts); in eem_free_inst()
575 struct f_eem_opts *opts; in eem_alloc_inst() local
577 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in eem_alloc_inst()
578 if (!opts) in eem_alloc_inst()
580 mutex_init(&opts->lock); in eem_alloc_inst()
581 opts->func_inst.free_func_inst = eem_free_inst; in eem_alloc_inst()
582 opts->net = gether_setup_default(); in eem_alloc_inst()
583 if (IS_ERR(opts->net)) { in eem_alloc_inst()
584 struct net_device *net = opts->net; in eem_alloc_inst()
585 kfree(opts); in eem_alloc_inst()
589 config_group_init_type_name(&opts->func_inst.group, "", &eem_func_type); in eem_alloc_inst()
591 return &opts->func_inst; in eem_alloc_inst()
597 struct f_eem_opts *opts; in eem_free() local
600 opts = container_of(f->fi, struct f_eem_opts, func_inst); in eem_free()
602 mutex_lock(&opts->lock); in eem_free()
603 opts->refcnt--; in eem_free()
604 mutex_unlock(&opts->lock); in eem_free()
617 struct f_eem_opts *opts; in eem_alloc() local
624 opts = container_of(fi, struct f_eem_opts, func_inst); in eem_alloc()
625 mutex_lock(&opts->lock); in eem_alloc()
626 opts->refcnt++; in eem_alloc()
628 eem->port.ioport = netdev_priv(opts->net); in eem_alloc()
629 mutex_unlock(&opts->lock); in eem_alloc()