]> err.no Git - linux-2.6/blobdiff - drivers/base/class.c
kobject: get rid of kobject_kset_add_dir
[linux-2.6] / drivers / base / class.c
index ecd6336bffea69f338b1f5588e162494a81165de..8ad98924cddbe5b81f2c6251b18b38b3f754cc9a 100644 (file)
@@ -65,13 +65,13 @@ static struct sysfs_ops class_sysfs_ops = {
        .store  = class_attr_store,
 };
 
-static struct kobj_type ktype_class = {
+static struct kobj_type class_ktype = {
        .sysfs_ops      = &class_sysfs_ops,
        .release        = class_release,
 };
 
 /* Hotplug events for classes go to the class_obj subsys */
-static decl_subsys(class, &ktype_class, NULL);
+static decl_subsys(class, NULL);
 
 
 int class_create_file(struct class * cls, const struct class_attribute * attr)
@@ -93,14 +93,14 @@ void class_remove_file(struct class * cls, const struct class_attribute * attr)
 static struct class *class_get(struct class *cls)
 {
        if (cls)
-               return container_of(subsys_get(&cls->subsys), struct class, subsys);
+               return container_of(kset_get(&cls->subsys), struct class, subsys);
        return NULL;
 }
 
 static void class_put(struct class * cls)
 {
        if (cls)
-               subsys_put(&cls->subsys);
+               kset_put(&cls->subsys);
 }
 
 
@@ -149,7 +149,8 @@ int class_register(struct class * cls)
        if (error)
                return error;
 
-       subsys_set_kset(cls, class_subsys);
+       cls->subsys.kobj.kset = &class_subsys;
+       cls->subsys.kobj.ktype = &class_ktype;
 
        error = subsystem_register(&cls->subsys);
        if (!error) {
@@ -323,7 +324,7 @@ static void class_dev_release(struct kobject * kobj)
        }
 }
 
-static struct kobj_type ktype_class_device = {
+static struct kobj_type class_device_ktype = {
        .sysfs_ops      = &class_dev_sysfs_ops,
        .release        = class_dev_release,
 };
@@ -332,7 +333,7 @@ static int class_uevent_filter(struct kset *kset, struct kobject *kobj)
 {
        struct kobj_type *ktype = get_ktype(kobj);
 
-       if (ktype == &ktype_class_device) {
+       if (ktype == &class_device_ktype) {
                struct class_device *class_dev = to_class_dev(kobj);
                if (class_dev->class)
                        return 1;
@@ -452,7 +453,7 @@ static struct kset_uevent_ops class_uevent_ops = {
        .uevent =       class_uevent,
 };
 
-static decl_subsys(class_obj, &ktype_class_device, &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);
 }
@@ -861,7 +863,7 @@ int __init classes_init(void)
 
        /* ick, this is ugly, the things we go through to keep from showing up
         * in sysfs... */
-       subsystem_init(&class_obj_subsys);
+       kset_init(&class_obj_subsys);
        if (!class_obj_subsys.kobj.parent)
                class_obj_subsys.kobj.parent = &class_obj_subsys.kobj;
        return 0;