aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-11-06 01:24:43 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:11 -0500
commit4ff6abff832fbc6cb1d769f6106c841bc2b09f63 (patch)
tree8458c8e29f53b67912edbe2424e43f95556832ce
parent3f9e3ee9dc3605e5c593b5d708494571fb0d3970 (diff)
kobject: get rid of kobject_add_dir
kobject_create_and_add is the same as kobject_add_dir, so drop kobject_add_dir. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/base/core.c3
-rw-r--r--fs/partitions/check.c6
-rw-r--r--include/linux/kobject.h1
-rw-r--r--kernel/module.c6
-rw-r--r--lib/kobject.c12
5 files changed, 8 insertions, 20 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index c8f2ac03d46d..992eba3289bd 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -562,7 +562,8 @@ static struct kobject *virtual_device_parent(struct device *dev)
562 static struct kobject *virtual_dir = NULL; 562 static struct kobject *virtual_dir = NULL;
563 563
564 if (!virtual_dir) 564 if (!virtual_dir)
565 virtual_dir = kobject_add_dir(&devices_subsys.kobj, "virtual"); 565 virtual_dir = kobject_create_and_add("virtual",
566 &devices_subsys.kobj);
566 567
567 return virtual_dir; 568 return virtual_dir;
568} 569}
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 722e12e5acc7..69685bb51c62 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -335,7 +335,7 @@ static inline void partition_sysfs_add_subdir(struct hd_struct *p)
335 struct kobject *k; 335 struct kobject *k;
336 336
337 k = kobject_get(&p->kobj); 337 k = kobject_get(&p->kobj);
338 p->holder_dir = kobject_add_dir(k, "holders"); 338 p->holder_dir = kobject_create_and_add("holders", k);
339 kobject_put(k); 339 kobject_put(k);
340} 340}
341 341
@@ -344,8 +344,8 @@ static inline void disk_sysfs_add_subdirs(struct gendisk *disk)
344 struct kobject *k; 344 struct kobject *k;
345 345
346 k = kobject_get(&disk->kobj); 346 k = kobject_get(&disk->kobj);
347 disk->holder_dir = kobject_add_dir(k, "holders"); 347 disk->holder_dir = kobject_create_and_add("holders", k);
348 disk->slave_dir = kobject_add_dir(k, "slaves"); 348 disk->slave_dir = kobject_create_and_add("slaves", k);
349 kobject_put(k); 349 kobject_put(k);
350} 350}
351 351
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 33e7a6142a75..7b09136fb211 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -105,7 +105,6 @@ extern void kobject_put(struct kobject *);
105 105
106extern struct kobject *kobject_kset_add_dir(struct kset *kset, 106extern struct kobject *kobject_kset_add_dir(struct kset *kset,
107 struct kobject *, const char *); 107 struct kobject *, const char *);
108extern struct kobject *kobject_add_dir(struct kobject *, const char *);
109 108
110extern char * kobject_get_path(struct kobject *, gfp_t); 109extern char * kobject_get_path(struct kobject *, gfp_t);
111 110
diff --git a/kernel/module.c b/kernel/module.c
index 68df79738b3b..55142775c581 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1122,7 +1122,7 @@ static void add_notes_attrs(struct module *mod, unsigned int nsect,
1122 ++loaded; 1122 ++loaded;
1123 } 1123 }
1124 1124
1125 notes_attrs->dir = kobject_add_dir(&mod->mkobj.kobj, "notes"); 1125 notes_attrs->dir = kobject_create_and_add("notes", &mod->mkobj.kobj);
1126 if (!notes_attrs->dir) 1126 if (!notes_attrs->dir)
1127 goto out; 1127 goto out;
1128 1128
@@ -1243,7 +1243,7 @@ int mod_sysfs_setup(struct module *mod,
1243 if (err) 1243 if (err)
1244 goto out; 1244 goto out;
1245 1245
1246 mod->holders_dir = kobject_add_dir(&mod->mkobj.kobj, "holders"); 1246 mod->holders_dir = kobject_create_and_add("holders", &mod->mkobj.kobj);
1247 if (!mod->holders_dir) { 1247 if (!mod->holders_dir) {
1248 err = -ENOMEM; 1248 err = -ENOMEM;
1249 goto out_unreg; 1249 goto out_unreg;
@@ -2521,7 +2521,7 @@ static void module_create_drivers_dir(struct module_kobject *mk)
2521 if (!mk || mk->drivers_dir) 2521 if (!mk || mk->drivers_dir)
2522 return; 2522 return;
2523 2523
2524 mk->drivers_dir = kobject_add_dir(&mk->kobj, "drivers"); 2524 mk->drivers_dir = kobject_create_and_add("drivers", &mk->kobj);
2525} 2525}
2526 2526
2527void module_add_driver(struct module *mod, struct device_driver *drv) 2527void module_add_driver(struct module *mod, struct device_driver *drv)
diff --git a/lib/kobject.c b/lib/kobject.c
index 98422a3eeffc..96b61d9a9284 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -713,18 +713,6 @@ struct kobject *kobject_kset_add_dir(struct kset *kset,
713} 713}
714 714
715/** 715/**
716 * kobject_add_dir - add sub directory of object.
717 * @parent: object in which a directory is created.
718 * @name: directory name.
719 *
720 * Add a plain directory object as child of given object.
721 */
722struct kobject *kobject_add_dir(struct kobject *parent, const char *name)
723{
724 return kobject_create_and_add(name, parent);
725}
726
727/**
728 * kset_init - initialize a kset for use 716 * kset_init - initialize a kset for use
729 * @k: kset 717 * @k: kset
730 */ 718 */