diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-11-05 22:24:43 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 20:40:11 -0800 |
commit | 43968d2f1648f4dc92437dc0363a3e88377445b3 (patch) | |
tree | c9ba656e289bbbb5d5de32abc4181ae1d65dee00 /drivers/base/core.c | |
parent | 4ff6abff832fbc6cb1d769f6106c841bc2b09f63 (diff) | |
download | linux-43968d2f1648f4dc92437dc0363a3e88377445b3.tar.gz linux-43968d2f1648f4dc92437dc0363a3e88377445b3.tar.bz2 linux-43968d2f1648f4dc92437dc0363a3e88377445b3.zip |
kobject: get rid of kobject_kset_add_dir
kobject_kset_add_dir is only called in one place so remove it and use
kobject_create() instead.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r-- | drivers/base/core.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index 992eba3289bd..7762ee86697d 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -571,6 +571,8 @@ static struct kobject *virtual_device_parent(struct device *dev) static struct kobject * get_device_parent(struct device *dev, struct device *parent) { + int retval; + if (dev->class) { struct kobject *kobj = NULL; struct kobject *parent_kobj; @@ -600,8 +602,18 @@ static struct kobject * get_device_parent(struct device *dev, return kobj; /* or create a new class-directory at the parent device */ - return kobject_kset_add_dir(&dev->class->class_dirs, - parent_kobj, dev->class->name); + k = kobject_create(); + if (!k) + return NULL; + k->kset = &dev->class->class_dirs; + retval = kobject_add_ng(k, parent_kobj, "%s", dev->class->name); + if (retval < 0) { + kobject_put(k); + return NULL; + } + /* Do not emit a uevent, as it's not needed for this + * "class glue" directory. */ + return k; } if (parent) |