• Home
  • Raw
  • Download

Lines Matching refs:mk

540 			       struct module_kobject *mk, char *buf)  in param_attr_show()  argument
548 kernel_param_lock(mk->mod); in param_attr_show()
550 kernel_param_unlock(mk->mod); in param_attr_show()
556 struct module_kobject *mk, in param_attr_store() argument
565 kernel_param_lock(mk->mod); in param_attr_store()
570 kernel_param_unlock(mk->mod); in param_attr_store()
607 static __modinit int add_sysfs_param(struct module_kobject *mk, in add_sysfs_param() argument
618 if (!mk->mp) { in add_sysfs_param()
620 mk->mp = kzalloc(sizeof(*mk->mp), GFP_KERNEL); in add_sysfs_param()
621 if (!mk->mp) in add_sysfs_param()
623 mk->mp->grp.name = "parameters"; in add_sysfs_param()
625 mk->mp->grp.attrs = kzalloc(sizeof(mk->mp->grp.attrs[0]), in add_sysfs_param()
628 if (!mk->mp->grp.attrs) in add_sysfs_param()
633 new_mp = krealloc(mk->mp, in add_sysfs_param()
634 sizeof(*mk->mp) + in add_sysfs_param()
635 sizeof(mk->mp->attrs[0]) * (mk->mp->num + 1), in add_sysfs_param()
639 mk->mp = new_mp; in add_sysfs_param()
642 new_attrs = krealloc(mk->mp->grp.attrs, in add_sysfs_param()
643 sizeof(mk->mp->grp.attrs[0]) * (mk->mp->num + 2), in add_sysfs_param()
647 mk->mp->grp.attrs = new_attrs; in add_sysfs_param()
650 memset(&mk->mp->attrs[mk->mp->num], 0, sizeof(mk->mp->attrs[0])); in add_sysfs_param()
651 sysfs_attr_init(&mk->mp->attrs[mk->mp->num].mattr.attr); in add_sysfs_param()
652 mk->mp->attrs[mk->mp->num].param = kp; in add_sysfs_param()
653 mk->mp->attrs[mk->mp->num].mattr.show = param_attr_show; in add_sysfs_param()
656 mk->mp->attrs[mk->mp->num].mattr.store = param_attr_store; in add_sysfs_param()
658 mk->mp->attrs[mk->mp->num].mattr.store = NULL; in add_sysfs_param()
659 mk->mp->attrs[mk->mp->num].mattr.attr.name = (char *)name; in add_sysfs_param()
660 mk->mp->attrs[mk->mp->num].mattr.attr.mode = kp->perm; in add_sysfs_param()
661 mk->mp->num++; in add_sysfs_param()
664 for (i = 0; i < mk->mp->num; i++) in add_sysfs_param()
665 mk->mp->grp.attrs[i] = &mk->mp->attrs[i].mattr.attr; in add_sysfs_param()
666 mk->mp->grp.attrs[mk->mp->num] = NULL; in add_sysfs_param()
671 static void free_module_param_attrs(struct module_kobject *mk) in free_module_param_attrs() argument
673 if (mk->mp) in free_module_param_attrs()
674 kfree(mk->mp->grp.attrs); in free_module_param_attrs()
675 kfree(mk->mp); in free_module_param_attrs()
676 mk->mp = NULL; in free_module_param_attrs()
745 struct module_kobject *mk; in locate_module_kobject() local
751 mk = to_module_kobject(kobj); in locate_module_kobject()
753 mk = kzalloc(sizeof(struct module_kobject), GFP_KERNEL); in locate_module_kobject()
754 BUG_ON(!mk); in locate_module_kobject()
756 mk->mod = THIS_MODULE; in locate_module_kobject()
757 mk->kobj.kset = module_kset; in locate_module_kobject()
758 err = kobject_init_and_add(&mk->kobj, &module_ktype, NULL, in locate_module_kobject()
762 err = sysfs_create_file(&mk->kobj, &module_uevent.attr); in locate_module_kobject()
765 kobject_put(&mk->kobj); in locate_module_kobject()
772 kobject_get(&mk->kobj); in locate_module_kobject()
775 return mk; in locate_module_kobject()
782 struct module_kobject *mk; in kernel_add_sysfs_param() local
785 mk = locate_module_kobject(name); in kernel_add_sysfs_param()
786 if (!mk) in kernel_add_sysfs_param()
790 if (mk->mp) in kernel_add_sysfs_param()
791 sysfs_remove_group(&mk->kobj, &mk->mp->grp); in kernel_add_sysfs_param()
794 err = add_sysfs_param(mk, kparam, kparam->name + name_skip); in kernel_add_sysfs_param()
796 err = sysfs_create_group(&mk->kobj, &mk->mp->grp); in kernel_add_sysfs_param()
798 kobject_uevent(&mk->kobj, KOBJ_ADD); in kernel_add_sysfs_param()
799 kobject_put(&mk->kobj); in kernel_add_sysfs_param()
838 struct module_kobject *mk, char *buf) in __modver_version_show() argument
852 struct module_kobject *mk; in version_sysfs_builtin() local
858 mk = locate_module_kobject(vattr->module_name); in version_sysfs_builtin()
859 if (mk) { in version_sysfs_builtin()
860 err = sysfs_create_file(&mk->kobj, &vattr->mattr.attr); in version_sysfs_builtin()
862 kobject_uevent(&mk->kobj, KOBJ_ADD); in version_sysfs_builtin()
863 kobject_put(&mk->kobj); in version_sysfs_builtin()
875 struct module_kobject *mk; in module_attr_show() local
879 mk = to_module_kobject(kobj); in module_attr_show()
884 ret = attribute->show(attribute, mk, buf); in module_attr_show()
894 struct module_kobject *mk; in module_attr_store() local
898 mk = to_module_kobject(kobj); in module_attr_store()
903 ret = attribute->store(attribute, mk, buf, len); in module_attr_store()
931 struct module_kobject *mk = to_module_kobject(kobj); in module_kobj_release() local
932 complete(mk->kobj_completion); in module_kobj_release()