summaryrefslogtreecommitdiffstats
path: root/drivers/base/core.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-11-01 09:29:06 -0600
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 20:40:15 -0800
commit881c6cfd7c5edfe6129006e2404654bfe5911050 (patch)
treecb8fa388d2b7c833d77e6ac4957310844a4e96af /drivers/base/core.c
parentb0d78e5549b44b3d64bf8b3ffe95280025ed102e (diff)
downloadlinux-881c6cfd7c5edfe6129006e2404654bfe5911050.tar.bz2
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,
static struct device_attribute devt_attr =
__ATTR(dev, S_IRUGO, show_dev, NULL);
-/*
- * devices_subsys - structure to be registered with kobject core.
- */
-
-decl_subsys(devices, &device_uevent_ops);
+/* kset to create /sys/devices/ */
+struct kset *devices_kset;
/**
@@ -525,7 +522,7 @@ static void klist_children_put(struct klist_node *n)
void device_initialize(struct device *dev)
{
- dev->kobj.kset = &devices_subsys;
+ dev->kobj.kset = devices_kset;
dev->kobj.ktype = &device_ktype;
kobject_init(&dev->kobj);
klist_init(&dev->klist_children, klist_children_get,
@@ -563,7 +560,7 @@ static struct kobject *virtual_device_parent(struct device *dev)
if (!virtual_dir)
virtual_dir = kobject_create_and_add("virtual",
- &devices_subsys.kobj);
+ &devices_kset->kobj);
return virtual_dir;
}
@@ -1097,7 +1094,10 @@ struct device * device_find_child(struct device *parent, void *data,
int __init devices_init(void)
{
- return subsystem_register(&devices_subsys);
+ devices_kset = kset_create_and_add("devices", &device_uevent_ops, NULL);
+ if (!devices_kset)
+ return -ENOMEM;
+ return 0;
}
EXPORT_SYMBOL_GPL(device_for_each_child);