aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-12-19 20:09:39 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:40 -0500
commitaf5ca3f4ec5cc4432a42a73b050dd8898ce8fd00 (patch)
tree3e5a3081b2802547f10da72c0026b4929d0e287b /drivers/base
parent528a4bf1d5ffed310d26fc1d82d45c02949f71cf (diff)
Driver core: change sysdev classes to use dynamic kobject names
All kobjects require a dynamically allocated name now. We no longer need to keep track if the name is statically assigned, we can just unconditionally free() all kobject names on cleanup. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/class.c2
-rw-r--r--drivers/base/cpu.c2
-rw-r--r--drivers/base/memory.c2
-rw-r--r--drivers/base/node.c2
-rw-r--r--drivers/base/sys.c1
5 files changed, 5 insertions, 4 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 61fd26cc9f0e..b962a76875d2 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -466,7 +466,6 @@ static struct kset_uevent_ops class_uevent_ops = {
466 * entirely soon. 466 * entirely soon.
467 */ 467 */
468static struct kset class_obj_subsys = { 468static struct kset class_obj_subsys = {
469 .kobj = { .k_name = "class_obj", },
470 .uevent_ops = &class_uevent_ops, 469 .uevent_ops = &class_uevent_ops,
471}; 470};
472 471
@@ -872,6 +871,7 @@ int __init classes_init(void)
872 /* ick, this is ugly, the things we go through to keep from showing up 871 /* ick, this is ugly, the things we go through to keep from showing up
873 * in sysfs... */ 872 * in sysfs... */
874 kset_init(&class_obj_subsys); 873 kset_init(&class_obj_subsys);
874 kobject_set_name(&class_obj_subsys.kobj, "class_obj");
875 if (!class_obj_subsys.kobj.parent) 875 if (!class_obj_subsys.kobj.parent)
876 class_obj_subsys.kobj.parent = &class_obj_subsys.kobj; 876 class_obj_subsys.kobj.parent = &class_obj_subsys.kobj;
877 return 0; 877 return 0;
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 40545071e3c9..c5885f5ce0ac 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -14,7 +14,7 @@
14#include "base.h" 14#include "base.h"
15 15
16struct sysdev_class cpu_sysdev_class = { 16struct sysdev_class cpu_sysdev_class = {
17 set_kset_name("cpu"), 17 .name = "cpu",
18}; 18};
19EXPORT_SYMBOL(cpu_sysdev_class); 19EXPORT_SYMBOL(cpu_sysdev_class);
20 20
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 7868707c7eda..7ae413fdd5fc 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -26,7 +26,7 @@
26#define MEMORY_CLASS_NAME "memory" 26#define MEMORY_CLASS_NAME "memory"
27 27
28static struct sysdev_class memory_sysdev_class = { 28static struct sysdev_class memory_sysdev_class = {
29 set_kset_name(MEMORY_CLASS_NAME), 29 .name = MEMORY_CLASS_NAME,
30}; 30};
31 31
32static const char *memory_uevent_name(struct kset *kset, struct kobject *kobj) 32static const char *memory_uevent_name(struct kset *kset, struct kobject *kobj)
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 88eeed72b5d6..e59861f18ce5 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -15,7 +15,7 @@
15#include <linux/device.h> 15#include <linux/device.h>
16 16
17static struct sysdev_class node_class = { 17static struct sysdev_class node_class = {
18 set_kset_name("node"), 18 .name = "node",
19}; 19};
20 20
21 21
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index e666441dd76b..2f79c55acdcc 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -136,6 +136,7 @@ int sysdev_class_register(struct sysdev_class * cls)
136 cls->kset.kobj.parent = &system_kset->kobj; 136 cls->kset.kobj.parent = &system_kset->kobj;
137 cls->kset.kobj.ktype = &ktype_sysdev_class; 137 cls->kset.kobj.ktype = &ktype_sysdev_class;
138 cls->kset.kobj.kset = system_kset; 138 cls->kset.kobj.kset = system_kset;
139 kobject_set_name(&cls->kset.kobj, cls->name);
139 return kset_register(&cls->kset); 140 return kset_register(&cls->kset);
140} 141}
141 142