]> err.no Git - linux-2.6/blobdiff - drivers/base/class.c
firmware: change firmware_kset to firmware_kobj
[linux-2.6] / drivers / base / class.c
index a863bb091e11db26e6e996dfa6fb341285d11991..d8a92c650b43a7127018b180c98c773d618ef5fe 100644 (file)
@@ -71,7 +71,7 @@ static struct kobj_type class_ktype = {
 };
 
 /* Hotplug events for classes go to the class_obj subsys */
-static decl_subsys(class, &class_ktype, NULL);
+static struct kset *class_kset;
 
 
 int class_create_file(struct class * cls, const struct class_attribute * attr)
@@ -149,7 +149,8 @@ int class_register(struct class * cls)
        if (error)
                return error;
 
-       cls->subsys.kobj.kset = &class_subsys;
+       cls->subsys.kobj.kset = class_kset;
+       cls->subsys.kobj.ktype = &class_ktype;
 
        error = subsystem_register(&cls->subsys);
        if (!error) {
@@ -452,7 +453,7 @@ static struct kset_uevent_ops class_uevent_ops = {
        .uevent =       class_uevent,
 };
 
-static decl_subsys(class_obj, &class_device_ktype, &class_uevent_ops);
+static decl_subsys(class_obj, &class_uevent_ops);
 
 
 static int class_device_add_attrs(struct class_device * cd)
@@ -537,7 +538,8 @@ static struct class_device_attribute class_uevent_attr =
 
 void class_device_initialize(struct class_device *class_dev)
 {
-       kobj_set_kset_s(class_dev, class_obj_subsys);
+       class_dev->kobj.kset = &class_obj_subsys;
+       class_dev->kobj.ktype = &class_device_ktype;
        kobject_init(&class_dev->kobj);
        INIT_LIST_HEAD(&class_dev->node);
 }
@@ -853,11 +855,9 @@ void class_interface_unregister(struct class_interface *class_intf)
 
 int __init classes_init(void)
 {
-       int retval;
-
-       retval = subsystem_register(&class_subsys);
-       if (retval)
-               return retval;
+       class_kset = kset_create_and_add("class", NULL, NULL);
+       if (!class_kset)
+               return -ENOMEM;
 
        /* ick, this is ugly, the things we go through to keep from showing up
         * in sysfs... */