• 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:kobject

2  * kobject.c - library routines for handling generic kernel objects
11 * Please see the file Documentation/kobject.txt for critical information
12 * about using the kobject interface.
15 #include <linux/kobject.h>
30 static int populate_dir(struct kobject *kobj)
47 static int create_dir(struct kobject *kobj)
61 static int get_kobj_path_length(struct kobject *kobj)
64 struct kobject *parent = kobj;
79 static void fill_kobj_path(struct kobject *kobj, char *path, int length)
81 struct kobject *parent;
92 pr_debug("kobject: '%s' (%p): %s: path = '%s'\n", kobject_name(kobj),
99 * @kobj: kobject in question, with which to build the path
104 char *kobject_get_path(struct kobject *kobj, gfp_t gfp_mask)
121 /* add the kobject to its kset's list */
122 static void kobj_kset_join(struct kobject *kobj)
133 /* remove the kobject from its kset's list */
134 static void kobj_kset_leave(struct kobject *kobj)
145 static void kobject_init_internal(struct kobject *kobj)
158 static int kobject_add_internal(struct kobject *kobj)
161 struct kobject *parent;
167 WARN(1, "kobject: (%p): attempted to be registered with empty "
182 pr_debug("kobject: '%s' (%p): %s: parent: '%s', set: '%s'\n",
210 * kobject_set_name_vargs - Set the name of an kobject
211 * @kobj: struct kobject to set the name of
215 int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
237 * kobject_set_name - Set the name of a kobject
238 * @kobj: struct kobject to set the name of
241 * This sets the name of the kobject. If you have already added the
242 * kobject to the system, you must call kobject_rename() in order to
243 * change the name of the kobject.
245 int kobject_set_name(struct kobject *kobj, const char *fmt, ...)
259 * kobject_init - initialize a kobject structure
260 * @kobj: pointer to the kobject to initialize
261 * @ktype: pointer to the ktype for this kobject.
263 * This function will properly initialize a kobject such that it can then
266 * After this function is called, the kobject MUST be cleaned up by a call
270 void kobject_init(struct kobject *kobj, struct kobj_type *ktype)
275 err_str = "invalid kobject pointer!";
284 printk(KERN_ERR "kobject (%p): tried to init an initialized "
294 printk(KERN_ERR "kobject (%p): %s\n", kobj, err_str);
299 static int kobject_add_varg(struct kobject *kobj, struct kobject *parent,
306 printk(KERN_ERR "kobject: can not set name properly!\n");
314 * kobject_add - the main kobject add function
315 * @kobj: the kobject to add
316 * @parent: pointer to the parent of the kobject.
317 * @fmt: format to name the kobject with.
319 * The kobject name is set and added to the kobject hierarchy in this
324 * kobject associted with the kset assigned to this kobject. If no kset
325 * is assigned to the kobject, then the kobject will be located in the
330 * Under no instance should the kobject that is passed to this function
336 * userspace is properly notified of this kobject's creation.
338 int kobject_add(struct kobject *kobj, struct kobject *parent,
348 printk(KERN_ERR "kobject '%s' (%p): tried to add an "
363 * kobject_init_and_add - initialize a kobject structure and add it to the kobject hierarchy
364 * @kobj: pointer to the kobject to initialize
365 * @ktype: pointer to the ktype for this kobject.
366 * @parent: pointer to the parent of this kobject.
367 * @fmt: the name of the kobject.
371 * kobject_add() and kobject lifetime rules are the same here.
373 int kobject_init_and_add(struct kobject *kobj, struct kobj_type *ktype,
374 struct kobject *parent, const char *fmt, ...)
396 * on the same kobject and to ensure that new_name is valid and
399 int kobject_rename(struct kobject *kobj, const char *new_name)
437 /* Install the new kobject name */
461 int kobject_move(struct kobject *kobj, struct kobject *new_parent)
464 struct kobject *old_parent;
508 * kobject_del - unlink kobject from hierarchy.
511 void kobject_del(struct kobject *kobj)
527 struct kobject *kobject_get(struct kobject *kobj)
535 * kobject_cleanup - free kobject resources.
538 static void kobject_cleanup(struct kobject *kobj)
543 pr_debug("kobject: '%s' (%p): %s\n",
547 pr_debug("kobject: '%s' (%p): does not have a release() "
553 pr_debug("kobject: '%s' (%p): auto cleanup 'remove' event\n",
560 pr_debug("kobject: '%s' (%p): auto cleanup kobject_del\n",
566 pr_debug("kobject: '%s' (%p): calling ktype release\n",
573 pr_debug("kobject: '%s': free name\n", name);
580 kobject_cleanup(container_of(kref, struct kobject, kref));
589 void kobject_put(struct kobject *kobj)
593 WARN(1, KERN_WARNING "kobject: '%s' (%p): is not "
600 static void dynamic_kobj_release(struct kobject *kobj)
602 pr_debug("kobject: (%p): %s\n", kobj, __func__);
612 * kobject_create - create a struct kobject dynamically
614 * This function creates a kobject structure dynamically and sets it up
615 * to be a "dynamic" kobject with a default release function set up.
617 * If the kobject was not able to be created, NULL will be returned.
618 * The kobject structure returned from here must be cleaned up with a
622 struct kobject *kobject_create(void)
624 struct kobject *kobj;
635 * kobject_create_and_add - create a struct kobject dynamically and register it with sysfs
638 * @parent: the parent kobject of this kobject, if any.
640 * This function creates a kobject structure dynamically and registers it
645 * If the kobject was not able to be created, NULL will be returned.
647 struct kobject *kobject_create_and_add(const char *name, struct kobject *parent)
649 struct kobject *kobj;
678 /* default kobject attribute operations */
679 static ssize_t kobj_attr_show(struct kobject *kobj, struct attribute *attr,
691 static ssize_t kobj_attr_store(struct kobject *kobj, struct attribute *attr,
744 * looking for a matching kobject. If matching object is found
747 struct kobject *kset_find_obj(struct kset *kset, const char *name)
749 struct kobject *k;
750 struct kobject *ret = NULL;
763 static void kset_release(struct kobject *kobj)
766 pr_debug("kobject: '%s' (%p): %s\n",
781 * @parent_kobj: the parent kobject of this kset, if any.
793 struct kobject *parent_kobj)
810 * The kobject of this kset will have a type of kset_ktype and belong to
825 * @parent_kobj: the parent kobject of this kset, if any.
836 struct kobject *parent_kobj)
896 const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent)
906 const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj)