aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
commit43968d2f1648f4dc92437dc0363a3e88377445b3 (patch)
treec9ba656e289bbbb5d5de32abc4181ae1d65dee00 /drivers
parent4ff6abff832fbc6cb1d769f6106c841bc2b09f63 (diff)
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')
-rw-r--r--drivers/base/core.c16
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)
571static struct kobject * get_device_parent(struct device *dev, 571static struct kobject * get_device_parent(struct device *dev,
572 struct device *parent) 572 struct device *parent)
573{ 573{
574 int retval;
575
574 if (dev->class) { 576 if (dev->class) {
575 struct kobject *kobj = NULL; 577 struct kobject *kobj = NULL;
576 struct kobject *parent_kobj; 578 struct kobject *parent_kobj;
@@ -600,8 +602,18 @@ static struct kobject * get_device_parent(struct device *dev,
600 return kobj; 602 return kobj;
601 603
602 /* or create a new class-directory at the parent device */ 604 /* or create a new class-directory at the parent device */
603 return kobject_kset_add_dir(&dev->class->class_dirs, 605 k = kobject_create();
604 parent_kobj, dev->class->name); 606 if (!k)
607 return NULL;
608 k->kset = &dev->class->class_dirs;
609 retval = kobject_add_ng(k, parent_kobj, "%s", dev->class->name);
610 if (retval < 0) {
611 kobject_put(k);
612 return NULL;
613 }
614 /* Do not emit a uevent, as it's not needed for this
615 * "class glue" directory. */
616 return k;
605 } 617 }
606 618
607 if (parent) 619 if (parent)