aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/core.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-11-01 11:29:06 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:15 -0500
commit881c6cfd7c5edfe6129006e2404654bfe5911050 (patch)
treecb8fa388d2b7c833d77e6ac4957310844a4e96af /drivers/base/core.c
parentb0d78e5549b44b3d64bf8b3ffe95280025ed102e (diff)
kset: convert /sys/devices to use kset_create
Dynamically create the kset instead of declaring it statically. We also rename devices_subsys to devices_kset to catch all users of the variable. 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.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 7762ee86697d..d2de2d59af42 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -401,11 +401,8 @@ static ssize_t show_dev(struct device *dev, struct device_attribute *attr,
401static struct device_attribute devt_attr = 401static struct device_attribute devt_attr =
402 __ATTR(dev, S_IRUGO, show_dev, NULL); 402 __ATTR(dev, S_IRUGO, show_dev, NULL);
403 403
404/* 404/* kset to create /sys/devices/ */
405 * devices_subsys - structure to be registered with kobject core. 405struct kset *devices_kset;
406 */
407
408decl_subsys(devices, &device_uevent_ops);
409 406
410 407
411/** 408/**
@@ -525,7 +522,7 @@ static void klist_children_put(struct klist_node *n)
525 522
526void device_initialize(struct device *dev) 523void device_initialize(struct device *dev)
527{ 524{
528 dev->kobj.kset = &devices_subsys; 525 dev->kobj.kset = devices_kset;
529 dev->kobj.ktype = &device_ktype; 526 dev->kobj.ktype = &device_ktype;
530 kobject_init(&dev->kobj); 527 kobject_init(&dev->kobj);
531 klist_init(&dev->klist_children, klist_children_get, 528 klist_init(&dev->klist_children, klist_children_get,
@@ -563,7 +560,7 @@ static struct kobject *virtual_device_parent(struct device *dev)
563 560
564 if (!virtual_dir) 561 if (!virtual_dir)
565 virtual_dir = kobject_create_and_add("virtual", 562 virtual_dir = kobject_create_and_add("virtual",
566 &devices_subsys.kobj); 563 &devices_kset->kobj);
567 564
568 return virtual_dir; 565 return virtual_dir;
569} 566}
@@ -1097,7 +1094,10 @@ struct device * device_find_child(struct device *parent, void *data,
1097 1094
1098int __init devices_init(void) 1095int __init devices_init(void)
1099{ 1096{
1100 return subsystem_register(&devices_subsys); 1097 devices_kset = kset_create_and_add("devices", &device_uevent_ops, NULL);
1098 if (!devices_kset)
1099 return -ENOMEM;
1100 return 0;
1101} 1101}
1102 1102
1103EXPORT_SYMBOL_GPL(device_for_each_child); 1103EXPORT_SYMBOL_GPL(device_for_each_child);