• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/lib/

Lines Matching refs:kset

97  * kobject_get_path - generate and return the path associated with a given kobj and kset pair.
121 /* add the kobject to its kset's list */
124 if (!kobj->kset)
127 kset_get(kobj->kset);
128 spin_lock(&kobj->kset->list_lock);
129 list_add_tail(&kobj->entry, &kobj->kset->list);
130 spin_unlock(&kobj->kset->list_lock);
133 /* remove the kobject from its kset's list */
136 if (!kobj->kset)
139 spin_lock(&kobj->kset->list_lock);
141 spin_unlock(&kobj->kset->list_lock);
142 kset_put(kobj->kset);
174 /* join kset if set, use it as parent if we do not already have one */
175 if (kobj->kset) {
177 parent = kobject_get(&kobj->kset->kobj);
185 kobj->kset ? kobject_name(&kobj->kset->kobj) : "<NULL>");
324 * kobject associted with the kset assigned to this kobject. If no kset
474 if (kobj->kset)
475 new_parent = kobject_get(&kobj->kset->kobj);
637 * @name: the name for the kset
668 * kset_init - initialize a kset for use
669 * @k: kset
671 void kset_init(struct kset *k)
709 * kset_register - initialize and add a kset.
710 * @k: kset.
712 int kset_register(struct kset *k)
728 * kset_unregister - remove a kset.
729 * @k: kset.
731 void kset_unregister(struct kset *k)
739 * kset_find_obj - search for object in kset.
740 * @kset: kset we're looking in.
743 * Lock kset via @kset->subsys, and iterate over @kset->list,
747 struct kobject *kset_find_obj(struct kset *kset, const char *name)
752 spin_lock(&kset->list_lock);
753 list_for_each_entry(k, &kset->list, entry) {
759 spin_unlock(&kset->list_lock);
765 struct kset *kset = container_of(kobj, struct kset, kobj);
768 kfree(kset);
777 * kset_create - create a struct kset dynamically
779 * @name: the name for the kset
780 * @uevent_ops: a struct kset_uevent_ops for the kset
781 * @parent_kobj: the parent kobject of this kset, if any.
783 * This function creates a kset structure dynamically. This structure can
789 * If the kset was not able to be created, NULL will be returned.
791 static struct kset *kset_create(const char *name,
795 struct kset *kset;
798 kset = kzalloc(sizeof(*kset), GFP_KERNEL);
799 if (!kset)
801 retval = kobject_set_name(&kset->kobj, name);
803 kfree(kset);
806 kset->uevent_ops = uevent_ops;
807 kset->kobj.parent = parent_kobj;
810 * The kobject of this kset will have a type of kset_ktype and belong to
811 * no kset itself. That way we can properly free it when it is
814 kset->kobj.ktype = &kset_ktype;
815 kset->kobj.kset = NULL;
817 return kset;
821 * kset_create_and_add - create a struct kset dynamically and add it to sysfs
823 * @name: the name for the kset
824 * @uevent_ops: a struct kset_uevent_ops for the kset
825 * @parent_kobj: the parent kobject of this kset, if any.
827 * This function creates a kset structure dynamically and registers it
832 * If the kset was not able to be created, NULL will be returned.
834 struct kset *kset_create_and_add(const char *name,
838 struct kset *kset;
841 kset = kset_create(name, uevent_ops, parent_kobj);
842 if (!kset)
844 error = kset_register(kset);
846 kfree(kset);
849 return kset;