aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/core.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index b3a931fe6b16..beb351600675 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -523,8 +523,7 @@ static void klist_children_put(struct klist_node *n)
523void device_initialize(struct device *dev) 523void device_initialize(struct device *dev)
524{ 524{
525 dev->kobj.kset = devices_kset; 525 dev->kobj.kset = devices_kset;
526 dev->kobj.ktype = &device_ktype; 526 kobject_init_ng(&dev->kobj, &device_ktype);
527 kobject_init(&dev->kobj);
528 klist_init(&dev->klist_children, klist_children_get, 527 klist_init(&dev->klist_children, klist_children_get,
529 klist_children_put); 528 klist_children_put);
530 INIT_LIST_HEAD(&dev->dma_pools); 529 INIT_LIST_HEAD(&dev->dma_pools);
@@ -729,7 +728,7 @@ static void device_remove_class_symlinks(struct device *dev)
729 * This is part 2 of device_register(), though may be called 728 * This is part 2 of device_register(), though may be called
730 * separately _iff_ device_initialize() has been called separately. 729 * separately _iff_ device_initialize() has been called separately.
731 * 730 *
732 * This adds it to the kobject hierarchy via kobject_add(), adds it 731 * This adds it to the kobject hierarchy via kobject_add_ng(), adds it
733 * to the global and sibling lists for the device, then 732 * to the global and sibling lists for the device, then
734 * adds it to the other relevant subsystems of the driver model. 733 * adds it to the other relevant subsystems of the driver model.
735 */ 734 */
@@ -760,8 +759,7 @@ int device_add(struct device *dev)
760 goto Error; 759 goto Error;
761 760
762 /* first, register with generic layer. */ 761 /* first, register with generic layer. */
763 kobject_set_name(&dev->kobj, "%s", dev->bus_id); 762 error = kobject_add_ng(&dev->kobj, dev->kobj.parent, "%s", dev->bus_id);
764 error = kobject_add(&dev->kobj);
765 if (error) 763 if (error)
766 goto Error; 764 goto Error;
767 765