aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kobject.c')
-rw-r--r--lib/kobject.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index 057921c5945a..f66455155606 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -488,13 +488,15 @@ static struct kobj_type dir_ktype = {
488}; 488};
489 489
490/** 490/**
491 * kobject_add_dir - add sub directory of object. 491 * kobject__kset_add_dir - add sub directory of object.
492 * @kset: kset the directory is belongs to.
492 * @parent: object in which a directory is created. 493 * @parent: object in which a directory is created.
493 * @name: directory name. 494 * @name: directory name.
494 * 495 *
495 * Add a plain directory object as child of given object. 496 * Add a plain directory object as child of given object.
496 */ 497 */
497struct kobject *kobject_add_dir(struct kobject *parent, const char *name) 498struct kobject *kobject_kset_add_dir(struct kset *kset,
499 struct kobject *parent, const char *name)
498{ 500{
499 struct kobject *k; 501 struct kobject *k;
500 int ret; 502 int ret;
@@ -506,6 +508,7 @@ struct kobject *kobject_add_dir(struct kobject *parent, const char *name)
506 if (!k) 508 if (!k)
507 return NULL; 509 return NULL;
508 510
511 k->kset = kset;
509 k->parent = parent; 512 k->parent = parent;
510 k->ktype = &dir_ktype; 513 k->ktype = &dir_ktype;
511 kobject_set_name(k, name); 514 kobject_set_name(k, name);
@@ -520,6 +523,11 @@ struct kobject *kobject_add_dir(struct kobject *parent, const char *name)
520 return k; 523 return k;
521} 524}
522 525
526struct kobject *kobject_add_dir(struct kobject *parent, const char *name)
527{
528 return kobject_kset_add_dir(NULL, parent, name);
529}
530
523/** 531/**
524 * kset_init - initialize a kset for use 532 * kset_init - initialize a kset for use
525 * @k: kset 533 * @k: kset