Commit 4ff6abff authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3f9e3ee9
...@@ -562,7 +562,8 @@ static struct kobject *virtual_device_parent(struct device *dev) ...@@ -562,7 +562,8 @@ static struct kobject *virtual_device_parent(struct device *dev)
static struct kobject *virtual_dir = NULL; static struct kobject *virtual_dir = NULL;
if (!virtual_dir) if (!virtual_dir)
virtual_dir = kobject_add_dir(&devices_subsys.kobj, "virtual"); virtual_dir = kobject_create_and_add("virtual",
&devices_subsys.kobj);
return virtual_dir; return virtual_dir;
} }
......
...@@ -335,7 +335,7 @@ static inline void partition_sysfs_add_subdir(struct hd_struct *p) ...@@ -335,7 +335,7 @@ static inline void partition_sysfs_add_subdir(struct hd_struct *p)
struct kobject *k; struct kobject *k;
k = kobject_get(&p->kobj); k = kobject_get(&p->kobj);
p->holder_dir = kobject_add_dir(k, "holders"); p->holder_dir = kobject_create_and_add("holders", k);
kobject_put(k); kobject_put(k);
} }
...@@ -344,8 +344,8 @@ static inline void disk_sysfs_add_subdirs(struct gendisk *disk) ...@@ -344,8 +344,8 @@ static inline void disk_sysfs_add_subdirs(struct gendisk *disk)
struct kobject *k; struct kobject *k;
k = kobject_get(&disk->kobj); k = kobject_get(&disk->kobj);
disk->holder_dir = kobject_add_dir(k, "holders"); disk->holder_dir = kobject_create_and_add("holders", k);
disk->slave_dir = kobject_add_dir(k, "slaves"); disk->slave_dir = kobject_create_and_add("slaves", k);
kobject_put(k); kobject_put(k);
} }
......
...@@ -105,7 +105,6 @@ extern void kobject_put(struct kobject *); ...@@ -105,7 +105,6 @@ extern void kobject_put(struct kobject *);
extern struct kobject *kobject_kset_add_dir(struct kset *kset, extern struct kobject *kobject_kset_add_dir(struct kset *kset,
struct kobject *, const char *); struct kobject *, const char *);
extern struct kobject *kobject_add_dir(struct kobject *, const char *);
extern char * kobject_get_path(struct kobject *, gfp_t); extern char * kobject_get_path(struct kobject *, gfp_t);
......
...@@ -1122,7 +1122,7 @@ static void add_notes_attrs(struct module *mod, unsigned int nsect, ...@@ -1122,7 +1122,7 @@ static void add_notes_attrs(struct module *mod, unsigned int nsect,
++loaded; ++loaded;
} }
notes_attrs->dir = kobject_add_dir(&mod->mkobj.kobj, "notes"); notes_attrs->dir = kobject_create_and_add("notes", &mod->mkobj.kobj);
if (!notes_attrs->dir) if (!notes_attrs->dir)
goto out; goto out;
...@@ -1243,7 +1243,7 @@ int mod_sysfs_setup(struct module *mod, ...@@ -1243,7 +1243,7 @@ int mod_sysfs_setup(struct module *mod,
if (err) if (err)
goto out; goto out;
mod->holders_dir = kobject_add_dir(&mod->mkobj.kobj, "holders"); mod->holders_dir = kobject_create_and_add("holders", &mod->mkobj.kobj);
if (!mod->holders_dir) { if (!mod->holders_dir) {
err = -ENOMEM; err = -ENOMEM;
goto out_unreg; goto out_unreg;
...@@ -2521,7 +2521,7 @@ static void module_create_drivers_dir(struct module_kobject *mk) ...@@ -2521,7 +2521,7 @@ static void module_create_drivers_dir(struct module_kobject *mk)
if (!mk || mk->drivers_dir) if (!mk || mk->drivers_dir)
return; return;
mk->drivers_dir = kobject_add_dir(&mk->kobj, "drivers"); mk->drivers_dir = kobject_create_and_add("drivers", &mk->kobj);
} }
void module_add_driver(struct module *mod, struct device_driver *drv) void module_add_driver(struct module *mod, struct device_driver *drv)
......
...@@ -712,18 +712,6 @@ struct kobject *kobject_kset_add_dir(struct kset *kset, ...@@ -712,18 +712,6 @@ struct kobject *kobject_kset_add_dir(struct kset *kset,
return k; return k;
} }
/**
* kobject_add_dir - add sub directory of object.
* @parent: object in which a directory is created.
* @name: directory name.
*
* Add a plain directory object as child of given object.
*/
struct kobject *kobject_add_dir(struct kobject *parent, const char *name)
{
return kobject_create_and_add(name, parent);
}
/** /**
* kset_init - initialize a kset for use * kset_init - initialize a kset for use
* @k: kset * @k: kset
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment